1

This is what I have :

<?php 
$textDelete = __('Delete' . ($index ? '' : ' This ' . $identifier));
$linkDelete = array('controller' => 'students', 'action' => 'delete', $id);
$confirmDelete = 'You are about to delete student:\n\n\x22'
                   . $student['Student']['last_name'] . ', ' 
                   . $student['Student']['first_name'] . ' ' 
                   . $student['Student']['middle_initial'] 
                   . '\x22\n\n  Are you sure?';

echo $this->Html->link(
                       $textDelete,
                       $linkDelete,
                       array('escape' => false),
                       $confirmDelete
                    );
 ?>

It was working fine, till we upgraded to CakePHP 2.4! Now the confirmation message (all of them) of the link shows the \n\n and \x22 instead of quotes symbol or new lines, any ideas?

salouri
  • 760
  • 1
  • 8
  • 19

1 Answers1

3

Honestly I was going to delete the question! But I thought its too silly for someone else to waste half a day on it! Just replace single quotes with double quotes and everything back to normal again! (embarrassing)

salouri
  • 760
  • 1
  • 8
  • 19
  • gosh darn it... still managed to waste 15 minutes... Thanks... forgot that newline and hex can't be used in apostrophes... also see: http://stackoverflow.com/q/4238433 and http://stackoverflow.com/questions/2531969 – Fr0zenFyr Sep 13 '15 at 14:05
  • Good Lord! this post is a life saver! Bumped again (embarrassing, me too!) – Fr0zenFyr Sep 20 '16 at 11:58