• Resolved hammouche

    (@hammouche)


    Hi,
    I’m implementing the plugin “maps and locations” and I’ve actived the google_autocomplete for location field. In the advert_add page I’ve no problem but in edit page I have this error (in debug mode)
    wp_enqueue_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.) in ***/functions.php on line 4147

    Do you have an idea of what I’m doing wrong ?

    PS: I don’t have this error in admin and with debug I found the problem appears in mode-autocomplete.php function wpadverts_mal_field_location when call function wp_enqueue_script( ‘wpadverts-mal-locate-autocomplete’ );

    Thanks

    • This topic was modified 8 years, 4 months ago by hammouche.
    • This topic was modified 8 years, 4 months ago by hammouche.
Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Greg Winiarski

    (@gwin)

    Hi,
    hmm any chance you have some SEO plugin enabled which might render the shortcodes in the meta tags?

    One thing you can try is to disable the SEO plugin and see if the problem goes away. I am checking the MAL add-on source code and the styles seem to be loaded properly so it looks like some kind of conflict with some other plugin or maybe with the theme.

    BTW. Can you let me know on which page exactly are you having this problem? From what i understand this is a page with [adverts_manage] shortcode?

    Thread Starter hammouche

    (@hammouche)

    Yes I have a SEO plugin, and I will try to disable this

    Yes, this problem appear just on the [adverts_manage] shortcode but not in add where the same function are used, it’s for this is very strange …

    Thread Starter hammouche

    (@hammouche)

    What is the difference when I use the shortcode adverts_manage and adverts_add for the location field ? is not the same back-end code ? (it will help me for my debugging)

    Plugin Author Greg Winiarski

    (@gwin)

    There actually isn’t any difference in both cases the execution path is:

    1. wpadverts-mal/wpadverts-mal.php calls wpadverts_mal_init() (called by action “init”) it registers the filters that will be used later.

    2. when rendering the shortcode (either [adverts_add] or [adverts_manage]) wpadverts_mal_form_load() function is called it replaces default location field with a custom one.

    3. when the location field is rendered the function wpadverts_mal_field_location() in wpadverts-mal/mode-autocomplete.php is called which enqueues the scripts and styles.

    One other thing you might try is to open wpadverts-mal.php remove from it (for a while) lines

    
        wp_enqueue_style( 'wpadverts-mal-map-icons' );
        wp_enqueue_style( 'adverts-icons' );
    

    and see if it helps.

    Thread Starter hammouche

    (@hammouche)

    I’ve remove the line, but it still doesn’t work. I Am very disappointed by this bug, I can’t understand how the same code can bug in one case and work in another …

    if you have an another suggestion.

    Thanks for your help

    Plugin Author Greg Winiarski

    (@gwin)

    I am afraid i cannot really think of anything else to change right now, can you send me your website URL via the contact form here https://wpadverts.com/contact/ i will take a look at the site it will be easier to tell then.

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Google_autocomplete location field, Error 500’ is closed to new replies.