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_dialog
GNU General Public License v2.0
1 stars 4 forks source link

Fatal error with core "Term Reference" fields #21

Closed laryn closed 2 months ago

laryn commented 8 months ago

I tried to change the widget on a core "Term Reference" field to "Autocomplete term widget (for References Dialog)" and then trying to save content gives a fatal error:

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'taxonomy_term_data.vid' in 'where clause': SELECT taxonomy_term_data.tid AS entity_id, taxonomy_term_data.vocabulary AS bundle, :entity_type AS entity_type, NULL AS revision_id FROM {taxonomy_term_data} taxonomy_term_data WHERE (taxonomy_term_data.name = :db_condition_placeholder_0) AND (taxonomy_term_data.vid IN (:db_condition_placeholder_1)) ; Array ( [:db_condition_placeholder_0] => Test [:db_condition_placeholder_1] => [:entity_type] => taxonomy_term )

robertgarrigos commented 3 months ago

I was looking into this but could not replicate the error. @laryn, do you still have this error?

laryn commented 3 months ago

I'll check when I'm back from vacation.

laryn commented 3 months ago

Can you limit to a certain vocabulary? That might trigger it.

robertgarrigos commented 3 months ago

no luck. no problem. enjoy your vacation :-)

robertgarrigos commented 2 months ago

Hi @laryn I just found a deprecated function within the code (taxonomy_term_uri). There is PR which might fix your issue. Would you like to try out before I merge? Thanks.

robertgarrigos commented 2 months ago

Hi @laryn, just hit your error even with my PR. Checking....

argiepiano commented 2 months ago

the problem starts with a Warning: Undefined property: TaxonomyVocabulary::$vid in references_dialog_term_reference_autocomplete_validate() (line 822 of /Users/XXX/Sites/localhost/bdtesting/modules/references_dialog/references_dialog.module).

Which is produced by code in references_dialog_term_reference_autocomplete_validate()

This function uses the deprecated taxonomy_vocabulary_machine_name_load(), AND uses $vocabulary->vid, which doesn't exist in Backdrop.

robertgarrigos commented 2 months ago

Thanks, @argiepiano just found the problem