Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Form Questions

custom form giving "...unexpected T_PAAMAYIM_NEKUDOTAYIM in \Controller.php(544) : eval()'d code on line 1" error


Reply

6 Posts   2627 Views

Avatar
grilldan

3 February 2009 at 9:38pm (Last edited: 3 February 2009 9:38pm), Community Member, 135 Posts

I made a widget with an upload form, and when I run it, I get this crazy error. If I'm not mistaken "T_PAAMAYIM_NEKUDOTAYIM" means "dubble dots" which could be ":" or ".." Line 544 on Controller.php reads '$accessPart = eval("return $className::\$allowed_actions;");' And no matter how I modify that line, the error isn't corrected. So I think there is something wrong with my code. I followed the widgets:forms documentation, and used "loadUploaded()" to upload the file.

Do you have any idea what could have caused this?

Avatar
martimiz

14 February 2009 at 7:37am (Last edited: 14 February 2009 7:38am), Forum Moderator, 1091 Posts

This message refers to unexpected double colon :: in PHP. This would happen if $classname wasn't set...

Avatar
Sean

14 February 2009 at 12:31pm (Last edited: 14 February 2009 12:32pm), Forum Moderator, 921 Posts

Perhaps you could show us your code on [url=http://pastie.org]pastie.org[/url]? :)

Sean

Avatar
grilldan

15 February 2009 at 3:20pm Community Member, 135 Posts

The code is viewable on another post I made. The error is the same.

[url]http://silverstripe.org/widgets-2/show/253865#post253865[/url]

Avatar
ajshort

15 February 2009 at 8:37pm Community Member, 244 Posts

You need to call parent::__construct() in your GalleryUpload_Controller->__construct() method

Avatar
grilldan

16 February 2009 at 1:37pm (Last edited: 16 February 2009 1:39pm), Community Member, 135 Posts

Thank you!!! I've been stuck on this for days. The files are not uploading, but at least that error is gone :D Thank you!

**edit*** the files are going to the "Upload" folder... I need to change that.