audrasjb / gdpr-data-request-form

Use WordPress Core GDPR tools to build front-end Personal Data export/erasure forms (includes Widget, Gutenberg Block, shortcode & Hooks).
https://wordpress.org/plugins/gdpr-data-request-form/
GNU General Public License v2.0
23 stars 9 forks source link

wp_localize_script is missing in my wp_footer #26

Open joldnl opened 4 years ago

joldnl commented 4 years ago

Somehow the script of the form doesnt work.

When I submit the form it redirects to admin-ajax.php page, because the nessecery script for posting the form as an ajax request is missing.

I'm using the Lumberjack startertheme from Rareloop. Other plugins, like Gravity Forms work perfectly.

garretthyder commented 4 years ago

Hi @joldnl is the script not present at all on the page?

From looking at the wp_register_script it set $in_footer to false so should actually be output in the wp_head. Code reference - https://github.com/audrasjb/gdpr-data-request-form/blob/master/public/enqueues.php#L21

Do you see any errors in the javascript console when you inspect the page?

Have you made any customizations that would have the form loaded dynamically on the front end?

The above is just some troubleshooting questions to help isolate the issue.

joldnl commented 4 years ago

The script is not in the wp_head, nor in the wp_footer. I've checked it with twentytwenty enabled, that worked out fine. The script was present...

There are no js errors, and, I have disabled all custom code in the theme (with lumberjack you load everything with classes, i've disabled all but with no effect).

garretthyder commented 4 years ago

Hmms it almost sounds more of a Lumberjack issue than one with this plugin.

Looking at the Lumberjack code have you customized the views/html-header.twig or views/base.twig? The base.twig file loads the html-header.twig file which runs the wp_head function. If any of those templates have been modified or omitted that would explain why the script doesn't output.

joldnl commented 4 years ago

Nop, i've not changed anything in the footer and header .twig files. The wp_footer and wp_head are loaded correctly. Whis works because Gravity Forms uses the same hooks, and these scripts are present as expected.

garretthyder commented 4 years ago

Is your site available online or would you be able to share files? If you'd prefer to DM links or files you can pass them to me (garrett-eclipse) on wp.org Slack.