paul121 / farm_rei

Adds restricted-entry interval (REI) fields to Input Logs and Materials.
1 stars 0 forks source link

Error: Call to a member function preview() on null in farm_dashboard_page_callback() (line 104 farm_dashboard.module). #4

Closed mstenta closed 3 years ago

mstenta commented 3 years ago

Updated to the latest commit and the farmOS dashboard broke with "An unexpected error has occurred..."

Looked in "Recent Log Messages" and found:

Error: Call to a member function preview() on null in farm_dashboard_page_callback() (line 104 of /var/www/html/profiles/farm/modules/farm/farm_dashboard/farm_dashboard.module).

Will take a closer look later... I simply rolled back to a previous working commit and that fixed it.

paul121 commented 3 years ago

Hmm. Sounds like Dashboard farm_rei block_active_rei isn't being detected. Maybe I goofed something up with the Features export. I'll see if I can "reset" locally

paul121 commented 3 years ago

@mstenta the views dependency had gotten removed from farm_rei.info - think that might be the cause? I pushed a commit adding it back.

To test I made changes to the farm_rei view locally and "reverted" so that it would re-load the view as defined in code (at least how I understand that to work?) All is working well.

mstenta commented 3 years ago

Hmm not sure what the issue was! I tried again, and the View was not there... but then after fiddling with it it appeared! Never experienced that before - but I'll just chock it up to some strange Features thing. :-)

paul121 commented 3 years ago

Did you test this with the latest commit 1cf5208d2bbab3943d0eb4f08b4392a54721d10e I pushed? Just want to make sure the commit I pushed to "fix" this issue didn't actually break it.

This was the previous commit that I suspected broke features/views since it removed the dependencies: https://github.com/paul121/farm_rei/commit/ba233d3bcf17157622e07d17a4afdcdd47f3b557

mstenta commented 3 years ago

I did test with the latest commit - but I don't think that is what fixed it.

Nevertheless, it's good to have the Views dependency in there. On a related note, I try to avoid features_exclude[dependencies] (which are added when you uncheck dependencies in the Features UI). I would recommend removing features_exclude[dependencies][ctools] = ctools and adding dependencies[] = ctools.