7

I have recently started to get the following error on a SafeCracker form in an ExpressionEngine v2.5.5 website.

A PHP Error was encountered
Severity: Notice
Message: Undefined property: EE::$view
Filename: libraries/File_field.php
Line Number: 618

Fatal error: Call to a member function head_link() on a non-object in /path/to/website/system/expressionengine/libraries/File_field.php on line 618

The other than standard text inputs, this form also references WYGWAM, P&T Checkboxes, P&T Dropdown, VZ URL and Safecracker File. The form has worked fine in the past, so not really sure what the heck is triggering this error now.

  • 1
    I have the same problem with one of my SC form. I noticed that it was occurring when there is a validation error, but I didn't figured out why it raise a php error. – pvledoux Aug 13 '14 at 13:57
  • I am having this problem as well, with my {exp:zoo_visitor:update_form} form. It only happens when there is a validation error. I'm on EE 2.9.0 and Zoo Visitor 1.3.32, and the line number it references is '704' – Gary Reckard Sep 22 '14 at 16:44
  • Oh, also, this error DOES NOT show up if I remove the 'error_handling="inline"' from my update_form tag... – Gary Reckard Sep 22 '14 at 17:15
  • I don't use safecracker nor do I use a version that old. But what the error is telling you is that the view library is not loaded when it's trying to use it. Is there a browser method that ends up calling the _browser_css method which is creating the error? Try ee()->load->library('view'); somewhere in there. – Steve Buzonas Feb 11 '15 at 21:48
  • How did you fare Brendon? Did the below answer help (please mark it as so if it did)? Are you still facing issues? – Blatant May 22 '15 at 9:05
1

That error is telling you that you don't have the view library loaded and you need it to make that call. Removing error_handling="inline" would prevent the errors from manipulating the view.

I'm assuming line 618 is loading css in a _browser_css method based on my version. That method is called by a browser method. Place ee()->load->library('view'); inside the browser method anywhere before the calls to the methods that require view.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.