D7.67: When Views Current Path is used on a multi-row view with editable fields, and attempting to use/submit one of those fields, the following errors are revealed:
An AJAX HTTP error occurred.
HTTP Result Code: 500
Debugging information follows.
Path: /system/ajax
StatusText: error
ResponseText:
An examination of the apache logs reveals the following related message:
PHP Fatal error: method_exists(): The script tried to execute a method or access a property of an incomplete object. Please ensure that the class definition "views_current_path_views_handler_field_current_path" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide an autoloader to load the class definition in /var/www/docroot/sites/all/modules/views/views.module on line 2060, referer: https://awesomedomainname.com/admin/manage-stuff
The issue disappears after removing the Views Current Path field from the list of fields in the view.
I initially posted to the Editable Field module (closed now), attaching to this issue for reference.
Comments
Comment #2
jweirather commentedAlso noting here: in this case, the Current Path field itself was not a part of the editable fields, it was being used in a rewrite of a "static" text displayed elsewhere in the row of data. It appears that just the presence of the field in the row of data was enough to trigger this.
Comment #3
hargobindWhich modules (and versions of those modules) do you have installed that are used to build the view? And it will be helpful if you can provide an export of the view too -- ideally a copy of the view with all the extra fields and displays removed to help narrow down this problem.
Comment #4
jweirather commentedThanks for reaching out! I created a test view that recreates the issue, will follow with other notes:
Comment #5
jweirather commented^^^ In this case, I created a test view of a single node type, adding the title and another sample field (phone number, in this case), making that Phone Number field editable using the Editable Fields module version: 7.x-1.0-alpha4. This view returns multiple rows of data, in this case, hundreds of records, paged 10 at a time.
At this point, the view works as expected. A user on the site can visit that view page and edit the text in a phone number field, with the ajax form submission working properly and updating the node accordingly.
I then add a Views Current Path field to the view and exclude it from display (though it doesn't seem to matter if it is displayed or not). Now, when a user visits the page and edits an editable field, the same error occurs as posted above. The error occurs during ajax submission of the editable field from the view page. The ajax error is shown to the user, and the corresponding PHP error is recorded to the logs.
Based on a cursory search, I was wondering whether this might be related to the PHP version?? (7.2.24-0ubuntu0.18.04.1)
Comment #7
hargobindThanks again for reporting this. Your description helped me debug it easily.
The problem here is that the views handler file was not specified in the .info file, which meant that Views could not correctly unserialize the object when loading the field because Drupal couldn't find the object class.
I created a new release to resolve this.
Comment #8
jweirather commentedHappy to help, thanks for the fix and feedback. Appreciated.