backdrop-contrib / references_dialog

Extends reference fields by adding links to add, edit, and search for references through a dialog.
https://backdropcms.org/project/references
GNU General Public License v2.0
1 stars 3 forks source link

Attempt to read property "type" on bool in references_dialog_node_reference_add_link() #19

Closed herbdool closed 8 months ago

herbdool commented 8 months ago

Warning: Attempt to read property "type" on bool in references_dialog_node_reference_add_link() (line 140 of /app/modules/contrib/references_dialog/references_dialog.dialog_widgets.inc).

This is probably an edge error, but can be easily avoided by checking if node_type_load() returns an actual object and not FALSE. In my case, someone had created a content type, it got referenced in a reference field with a dialog, and then later the content type was deleted.

herbdool commented 8 months ago

@robertgarrigos I have a small PR which can fix a fatal error, which can happen with the right conditions.