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

leaflet maps do not load in categories edit admin pages #1

Open
niedakh opened this issue Aug 10, 2017 · 17 comments
Open

leaflet maps do not load in categories edit admin pages #1

niedakh opened this issue Aug 10, 2017 · 17 comments
Assignees
Labels

Comments

@niedakh
Copy link

niedakh commented Aug 10, 2017

Hi,

when the geometa acf field is assigned to both a post and category taxonomy, the version 0.0.4 does not load leaflet JS files on category edit page.

image

@nciske
Copy link
Contributor

nciske commented Aug 10, 2017

Thanks for reporting this! We'll look at pushing a fix.

@niedakh
Copy link
Author

niedakh commented Aug 24, 2017

Hi, any hints how to fix this, where to look for the bug? I could do a PR if you guide me.

@stuporglue
Copy link
Collaborator

stuporglue commented Aug 24, 2017 via email

@stuporglue
Copy link
Collaborator

Hi again Piotr,

Can you tell me more about how your ACF field is defined?

I'm testing with ACF rules like this, and it's working (default Post type and default taxonomy term category).

image

Also, how did you install Geometa For ACF? From the plugin repository, or from GitHub?

Thanks,
Michael Moore

@niedakh
Copy link
Author

niedakh commented Sep 8, 2017

Hi,

tested with both, neighter plugin repository nor github works in the case you show. this is how the field looks like:

image

image

@niedakh
Copy link
Author

niedakh commented Sep 8, 2017

i'm using wp geometa 0.3.4 and acf 4.4.11 the map editor renders correctly on posts with these settings

@niedakh
Copy link
Author

niedakh commented Sep 8, 2017

Can I just force put the javascript link ref in the admin page somewhere to get this working asap as a workaround?

@stuporglue
Copy link
Collaborator

Thanks for the screenshots, I was able to reproduce the issue and think I have it fixed. Please let me know if it doesn't work for you now.

The 0.0.5 beta release is here:
https://github.com/BrilliantPlugins/geometa-acf/releases/tag/0.0.5-beta

If you'd like to see what changed, it was in leaflet-php and the changes are here:

I missed the fact that since ACF 4 loads the fields via an admin-ajax call, the header scripts and styles were never dequeued in leaflet-php. This change dequeues them the first time a map is printed.

This is a beta release and I have not tested it as thoroughly as I will before the actual release. As such, there may be bugs, so please test before deploying.

@niedakh
Copy link
Author

niedakh commented Sep 9, 2017

Hi,

it still doesn't work for me - i've setup a wp-latest from scratch took the plugin from your prerelease, set it up exactly like earlier, here's the debug console now:

zrzut ekranu 2017-09-10 o 00 28 05

@stuporglue
Copy link
Collaborator

I'm no longer able to reproduce the error here, but I thought of what should be a more robust way to ensure that the required libraries get loaded.

The problem is that there's no map on the page when the page loads, so the usual wp_enqueue_script doesn't load Leaflet or the Leaflet plugins. Instead, the ACF field gets loaded by ajax after the main page loads.

Please uninstall the version of geometa-acf that you have installed and try the version attached here:

geometa-acf_0.0.5-beta2.zip

Thanks,
Michael Moore

@niedakh
Copy link
Author

niedakh commented Sep 27, 2017

Unfortunately the map is still not there with acf 0.0.5beta2 and newest acf4 and newest wordpress.

@stuporglue
Copy link
Collaborator

Can you try disabling all plugins except ACF and Geometa for ACF and see if the map appears then?

Perhaps there's an unexpected conflict with another plugin. If the map does appear with other plugins disabled, tracking down which plugin Geometa for ACF conflicts with would be the next step.

Thanks,
Michael

@niedakh
Copy link
Author

niedakh commented Sep 27, 2017

I've disabled all plugins left just geometa for acf, wp-geometa and acf. still not working.
image

@stuporglue
Copy link
Collaborator

stuporglue commented Sep 27, 2017 via email

@niedakh
Copy link
Author

niedakh commented Sep 27, 2017

Plugin Name | WP-GeoMeta Version
GeoMeta for ACF | 0.3.3
WP-GeoMeta (In Use) | 0.3.3

disabling wp-geometa causes javascript errors in missing properties of objects and the map does not load

@niedakh
Copy link
Author

niedakh commented Sep 27, 2017

it also says

Odd Situation! You have the latest version of WP-GeoMeta, but another plugin is providing an older version WP-GeoMeta-Lib Please update the plugin(s) not providing version 0.3.3 in the list below!

@niedakh
Copy link
Author

niedakh commented Sep 27, 2017

(but all of them provide 0.3.3)

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

No branches or pull requests

3 participants