Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Metaboxes don't seem to respect the WordPress prefix #7287

Open
russell-edsvcs opened this issue Apr 2, 2024 · 2 comments
Open

Metaboxes don't seem to respect the WordPress prefix #7287

russell-edsvcs opened this issue Apr 2, 2024 · 2 comments

Comments

@russell-edsvcs
Copy link

Description

When the WordPress prefix changes, pods displays an error message in the WordPress admin area. Upon investigation, it looks like the WordPress prefix is hardcoded into the data saved for the metabox. Specifically in plugins\pods\classes\PodsMeta.php the $metabox parameter that is being passed to the PodsMeta->meta_post function has the WordPress prefix hardcoded into $metabox['args']['group']['fields'][{field_name}]->args['pick_object'].

Version

3.2.1

Testing Instructions

Data has to have been previously been saved in a field under a different WordPress prefix for this error to occur. In my case I the field was a simple dropdown field, but I assume it would happen with other fields too.

Screenshots / Screencast

image

And the error message as text:

WordPress database error: [Table 'local.ezxi_country' doesn't exist]
SELECT DISTINCT `t`.`id`, `t`.`name` FROM `ezxi_country` AS `t` ORDER BY `t`.`name`, `t`.`id`

Database Error; SQL: SELECT DISTINCT `t`.`id`, `t`.`name` FROM `ezxi_country` AS `t` ORDER BY `t`.`name`, `t`.`id`; Response: Table 'local.ezxi_country' doesn't exist

Possible Workaround

No response

Site Health Information

No response

Pods Package

No response

@russell-edsvcs
Copy link
Author

russell-edsvcs commented May 1, 2024

Some more info on this.

When I do a query for

SELECT * FROM wp_postmeta WHERE meta_value LIKE '%bh3_eci_country%';

I get back 2 results for different pods fields.

image

Looking into the pods field on the site I found this

image

A simple relationship that doesn't have the textarea input.

Also, there isn't a database table with the name ezxi_country. I'll keep you updated with anything else I find out about this.

@russell-edsvcs
Copy link
Author

I fixed the problem by doing the following:

I deleted both of the database entries (probably didn't need to do that) and then went through the 3 different simple field relationships that I had in my pod. For each one, I selected something else for the "related Type" field and then I selected "simple (custom defined list)" again. The "Custom Defined Options" textarea box now correctly showed up, and was blank. I added in some placeholder text into the box, hit save field and save pod, and that seems to have solved the problem for me. I no longer get the error message in the WordPress backend.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant