Jump to content

Notice: Undefined index: searchFields after update to 2.5 dev


gebeer
 Share

Recommended Posts

Hi,

I upgraded a site in development from 2.5 stable to 2.5.7 dev by copying /wire/, index.php and .htaccess over.

After the upgrade, I get a notice on frontend and before login to the admin, when $config->debug = true

Notice: Undefined index: searchFields in /var/www/pwbootstrap3/wire/modules/System/SystemUpdater/SystemUpdate5.php on line 128

After login there is no admin page visible, only debug info.

I can see in the Variables on local scope that $admin returns a nullpage.

When I switch debug to false, I can see and use the admin.

Couldn't find anything related here in the forum.

Any pointers how I can fix this? Thank you.

Link to comment
Share on other sites

You could fix this by modifying the given line from

if($data['searchFields'] == 'title body') {

to

if(isset($data['searchFields']) && $data['searchFields'] == 'title body') {

Seems that $data['searchFields'] is undefined, thats causing it to throw a notification.

In general notifications are not much of a problem, altough if it occurs a lot the error.log file can grow tremendously large.

I remember having to look at a site suffering from undefined variables in a loop, causing it to write 5 lines to the log file for every visitor to the page, by the time the problem was noted the log file was over 2 GB.

Not that the specific notification you mention will do that, as far i know that SystemUpdate script is only run once.

  • Like 1
Link to comment
Share on other sites

Thank you. This helped partially. But it is only a temporary fix because with the next upgrade it will be overridden. I would consider this a bug.

Now when I login, I can see the admin but all update messages are persistent

post-1920-0-33121100-1414978600_thumb.pn

When I click them away, they always reappear on the next page load.

When I try and edit a page I get a notice but can edit the page.

Notice: Undefined index: limit in /var/www/pwbootstrap3/wire/modules/Process/ProcessPageEdit/ProcessPageEdit.module on line 994

That line says

$limit = $pageListConfig['limit'];

So things seem a bit messy overall after the upgrade and I would really like to be able to fix this.

Link to comment
Share on other sites

The first issue was fixed and will be available in the dev branch.

You mention that you see the System Updater messages on each page load in the admin section, this is something Ryan might have to take a look at since it actualy has to run only once, so it seems its not applying the system updates in the database.

On PW 2.5.6 and 2.5.7 i do not see these notifications when $config->debug = true;

edit: forgot the not in "i do not see"

Edited by Raymond Geerts
  • Like 1
Link to comment
Share on other sites

Most likely your php.ini file has set error_reporting to some value that contains E_NOTICE

Setting $config->debug = true; will do the same and show E_NOTICE.

In a devlopment environment this can be desirable. On a live server i would change this to something like E_ALL & ~E_NOTICE

See the following page for more information on error reporting.

http://php.net/manual/en/function.error-reporting.php

If you want to hide the notices when $config->debug = false; you should change error_reporting to E_ALL & ~E_NOTICE if you have access to the php.ini file.

  • Like 2
Link to comment
Share on other sites

I doubt that using php.ini will help here as error_reporting and ini_set is set in the index.php

Not all servers let you set error_reporting from inside a php script. Gebeer mentioned that he saw notices even with $config->debug = false; So i presumed that on his server this is the case.

Link to comment
Share on other sites

Gebeer mentioned that he saw notices even with $config->debug = false;

My post about that might be a little confusing.

I do not get any error messages when I set debug to false. I was referring to the system messages from my screenshot in post #3 that are persistent.

Sorry if this has caused you additional work.

Link to comment
Share on other sites

  • 1 month later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...