I've upgraded a fairly complex site from Drupal 7 to Backdrop 1.22. When the update process finished, I got a few error messages related to three specific modules (Node Notify, XML Sitemap, Entity Reference), all of which I managed to fix by either reinstalling the module or by changing some settings on various related administration pages. There are two other errors left that are giving me a hard time.

1. On view pages that use the Views Selective Exposed Filters module I get:

Warning: Creating default object from empty value in views_handler_filter_selective->get_oids() (line 318 of C:\xampp\htdocs\backdrop\modules\views_selective_filters\views\views_handler_filter_selective.inc).
Warning: Creating default object from empty value in views_handler_filter_selective->get_oids() (line 319 of C:\xampp\htdocs\backdrop\modules\views_selective_filters\views\views_handler_filter_selective.inc).

The referenced lines from views_handler_filter_selective.inc are:

// Also disable attachments.
$display->handler->definition['accept attachments'] = FALSE;
$display_default->handler->definition['accept attachments'] = FALSE;

I don't know what to make of this. I've tried reinstalling the Views UI and Views Selective Exposed Filters and also creating a new view using selective exposed filters but I always get the same message. I've tested the module on a fresh Backdrop installation with no issues.

2. On content pages related to the H5P module I get:

Deprecated function: Array and string offset access syntax with curly braces is deprecated in require_once() (line 4045 of C:\xampp\htdocs\backdrop\core\includes\bootstrap.inc).
Deprecated function: Array and string offset access syntax with curly braces is deprecated in require_once() (line 4045 of C:\xampp\htdocs\backdrop\core\includes\bootstrap.inc).

Strangely, when I checked the referenced line in bootstrap.inc, I found:

require_once $class_registry[$class];

(There are no curly braces.)

I've also tried reinstalling the H5P module but the error message didn't go away.

I would suppose that these are not very serious errors and they wouldn't affect the functionality of the site if I turned off error reporting, but I'd prefer not to do that.

Do you have any thoughts on what might be triggering these errors and how I could go about fixing them?

Accepted answer

Re H5P errors, this is probably the same as this Drupal issue: https://www.drupal.org/project/h5p/issues/3126374. THe Backdrop H5P libraries havent been updated to latest. Youll need to temporarily make those changes manually in the affected H5P library files, until we update the library.

Comments

Re H5P errors, this is probably the same as this Drupal issue: https://www.drupal.org/project/h5p/issues/3126374. THe Backdrop H5P libraries havent been updated to latest. Youll need to temporarily make those changes manually in the affected H5P library files, until we update the library.

Thank you, @docwilmot. I applied the patch to h5p-development.class.php and h5p.classes.php that was suggested in the Drupal forum, and the error messages stopped.

Regarding the first issue: my guess is that you have installed a contrib module that defines a new display ("views displays" are the ones you select under the option "+ Add" under displays in the views ui, for example, Block, Page, etc).

The problem is that the new display provided by the contrib module is not defining 'accept attachments' in its handler plugin definition. 'Accept attachments'  is a flag that is either true or false and indicates if the display can accept attachments (Attachments are displays that are created under "+ Add" -> Attachments). This flag is defined within the display handler definition usually in file XXX.views.inc, within the implementation of hook_views_plugins()

So the key here is to figure out which contrib module you have that is creating a new Views Display, and then find why that module is not defining 'accept attachments'. Then probably start an issue in that module on github. A good start is to click the + Add button and paste here the displays that are shown - if you want me to help you troubleshoot.

I hope this helps. 

Thanks a lot for your reply, @argiepiano. There are two Views Displays under "+ Add" that are defined by contrib modules: Entity Reference, and References. These displays are not used in the specific view, and actually, on those Views pages that use either of the two displays, I don't get any error messages. I suppose that's because I don't have Selective Exposed Filters there.
I've tried to reproduce the issue on a clean Backdrop install by enabling the two contrib modules and creating a view using the Selective Exposed Filters module, but the message didn't show up. Also, I get the error on PHP 7.4.29 but not on 5.6.40.

How can I find out why these two modules are not defining 'accept attachments'?

I've checked both Reference and Entity Reference - the display handlers they define contain that 'accept attachments' flag correctly.

So the problem is more complex than that. Without the actual view it's hard to debug. Here's a wild guess without any testing: you may have upgraded a view that used a display defined by a module that was disabled in D7 before upgrading. So, the view itself may still contain a reference to a display plugin that doesn't exist in your Backdrop site. Are you getting the error when visiting a specific view? If so, you may want to go to files/config_XXX/active and find the json file where that view's definition is held (the file should look like views.view.VIEWNAME.json). 

Open that json file and look at the list of displays under the 'display' key. Look specifically at the display_plugin keys and check if any plugin there  looks suspicious (or if there is a plugin not defined by any module). 

Thank you for taking the time to look into this. I'm only getting this error when visiting views that use Selective Exposed Filters. I've checked the related view json files but didn't find any suspicious display plugins. I only have these ones:

"display_plugin": "default",
"display_plugin": "page",

When I check the original Drupal 7 view admin page, however, I see the display type option Date Browser, which I suppose came with the Date Views module. I've searched for traces of the string "date_browser" in the Backdrop database and in the json config files, but found nothing.

In the log I also get the message from Views: Invalid display extender @extender.

Is there anything else you think I could try?

Thank you for taking the time to look into this. I'm only getting this error when visiting views that use Selective Exposed Filters. I've checked the related view json files but didn't find any suspicious display plugins besides these ones:

"display_plugin": "default",
"display_plugin": "page",

When I check the original Drupal 7 view admin page, however, I see the display type option Date Browser, which I suppose came with the Date Views module. I've searched for traces of the string "date_browser" in the database and in the json config files, but found nothing.

In the log I also get this message from Views: Invalid display extender @extender.

Is there anything else you think I could try?

The display extender error may be important. Can you check those same json files and look for the key 'display_extender' ? You may have a contrib module display extender enabled that's not available in Backdrop

Also check the file views.settings.json to see if there are any display extenders listed there

There is a line in views.settings.json that refers to display extenders:

    "display_extenders": {
        "metatags": "metatags"
    },

I have the Metatag module enabled on the Backdrop site, so I'm not sure this causes the error. Just to make sure, I tried uninstalling Metatag as well as replacing the value in the line above with "[]", but that didn't fix it.

I've just managed to reproduce the error message on a clean Backdrop install using the following steps:

  • Install Backdrop and the Views Selective Exposed Filters module
  • Create some content and a View with a Page display using a Selective Exposed Filter
  • On the Logging and errors admin page under "Error messages to display" select "All messages"
  • Visit the view page

It seems that the problem is not related to migration from Drupal after all.

Thanks. I'll give that a try and will report back

Confirmed. I'm able to reproduce the error (and other errors). This is a Views Selective Exposed Filter problem. You'll need to create an issue in their issue queue, and hope that the maintainer will get to it soon.

https://github.com/backdrop-contrib/views_selective_filters/issues

It seems like the module hasn't had much activity since 2019... 

Good luck!

 

 

I appreciate your response, @argiepiano. I'll definitely create an issue on the project's GitHub page.