I built several form blocks in a custom module (D7). These forms display a select list of data pulled from a SOAP service server, are sequential, first form selected data is needed on second form, ... up to 5 form blocks, and blocks were added on a panels node/view page, meaning that I have in context the node being viewed, but my blocks get the nid by url. Everything works as needed, but I would like to get rid of the warnings (a lot of them). I used a node/view in panels because after every form completed I update node being viewed. An image says more than a thousand words. Thanks.

enter image description here

  • Can you post any of your code? These notices are showing line numbers. What is happening on those lines? Have you used xdebug to test values along the way to see what type of data you are getting as it appears from these errors that you are expecting an object, but getting some other form of data.
    – shelane
    Aug 24 at 17:44
  • thanks for asking, i hope you can help me, new img: i.imgur.com/TD1B1aa.png, code: i.imgur.com/obHFM00.png
    – pinueve
    Aug 24 at 17:52

The node_load function is going to return FALSE if the node is not found. Add a check for the node before trying to call a member function of it. Such as:

$modelo = $node ? $node->field_amis_modelo[LANGUAGE_NONE][0]['value'] : '';
  • Thanks shelane, i don't think that's the problem, node always is found, node is first created by rules, reacting on a click event and after that is viewed in panels, on node creation, is filled with default data (with no empty fields), i use this data to compare it inside my module, so i know what form show and the rest of the forms are hidden.
    – pinueve
    Aug 24 at 18:15
  • Then I would encourage you to test with xdebug and put breakpoints in place to see what the data is at this point.
    – shelane
    Aug 24 at 18:17
  • Also, the image you posted does not cover the code lines that are reported in the errors.
    – shelane
    Aug 24 at 18:20

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.