New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed FormHelper::postLink() for baked files. #3482

Closed
wants to merge 1 commit into
base: master
from

Conversation

Projects
None yet
3 participants
@zuborawka

zuborawka commented May 13, 2014

Null is set as a 3rd parameter in the files baked by Console.

Fixed FormHelper::postLink() for baked files.
Null is set into the method as a 2nd parameter in the files baked by Console.
@@ -1799,6 +1799,9 @@ public function postButton($title, $url, $options = array()) {
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/form.html#FormHelper::postLink
*/
public function postLink($title, $url = null, $options = array(), $confirmMessage = false) {
if ($options === null) {

This comment has been minimized.

@dereuromark

dereuromark May 13, 2014

Member

Why would it be null - in what case? The doc block states that always an array should be passed in.

@dereuromark

This comment has been minimized.

Member

dereuromark commented May 13, 2014

👎 as this does not resolve the source of the issue, it only hotfixes the symptoms.
The original call to it should be fixed IMO to not pass null, but a proper array. In this case the bake templates.

@zuborawka

This comment has been minimized.

zuborawka commented May 13, 2014

You mean that to fix view files which generated by bake command instead of this method ?

@zuborawka

This comment has been minimized.

zuborawka commented May 13, 2014

OK. thanks.

@dereuromark

This comment has been minimized.

Member

dereuromark commented May 13, 2014

Yes exactly :)
If we decide to keep this little adjustment for BC reasons, we might want to simplify it using cast:

$options = (array)$options;

Only one additional line then.

@zuborawka

This comment has been minimized.

zuborawka commented May 13, 2014

I got it !

@zuborawka zuborawka closed this May 13, 2014

@markstory markstory added this to the 2.5.1 milestone May 13, 2014

@zuborawka zuborawka deleted the zuborawka:fixed-formhelper-postlink branch May 16, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment