WordPress.org

Ready to get started?Download WordPress

Forums

AdRotate
[resolved] Error, no Ad ID set! Check your syntax! Version 3.7.3 (29 posts)

  1. yorgict
    Member
    Posted 2 years ago #

    Hello,

    After updating to the latest version I see this error:
    Error, no Ad ID set! Check your syntax!

    I cannot update any new ads.

    Any help is greatly appreciated. I have all the latest for WordPress and Headway.

    Thanks

    http://wordpress.org/extend/plugins/adrotate/

  2. matt-tyas
    Member
    Posted 2 years ago #

    Hi,

    I also have this problem after the update.

    I get this too: Error, no Ad ID set! Check your syntax!

    I cannot create any new ads. I go through the admin screen fill in all the required fields then on save I get the, "The ad was saved but has an issue which might prevent it from working properly. Review the yellow marked ad." message, however there is no Yellow Ad in the list to edit.

    WordPress 3.4.1

  3. netmeg
    Member
    Posted 2 years ago #

    I'm having this same problem. It worked fine on five of my sites, but I can't get past this error on the sixth site.

  4. deadhippo
    Member
    Posted 2 years ago #

    I am getting this error too. I get it when I use the adrotate widgets but I get a different error (worse) when I use the adrotate shortcode in a widget:

    http://wordpress.org/support/topic/plugin-adrotate-widget-errors-for-expired-or-removed-ads?replies=2#post-3030645

    I get the error for expired ads.

  5. antonio nardelli
    Member
    Posted 2 years ago #

    same problem:
    Error, no Ad ID set! Check your syntax!

  6. Mcurly
    Member
    Posted 2 years ago #

    Hello, I have the same issue, I updated the plugin and I can no more add or edit ads.

  7. cutzu
    Member
    Posted 2 years ago #

    Hey, i get this error: Warning: in_array() expects parameter 2 to be array, null given in [removed]/public_html/wp-content/plugins/adrotate/adrotate-functions.php on line 186

    if i deactivate the plugin it will shut down my website

  8. disturbedrod
    Member
    Posted 2 years ago #

    I'm getting also the same problem as cutzu

    Warning: in_array() expects parameter 2 to be array, null given in [removed]/public_html/wp-content/plugins/adrotate/adrotate-functions.php on line 186

    hopefully a fix will be provided soon

  9. Arnan de Gans
    Member
    Plugin Author

    Posted 2 years ago #

    Dev here -

    Can some (or all) of you confirm that the targetclicks and targetimpressions columns do *not* exist in the wp_adrotate table and let me know?
    You can check this in PHPMyadmin.

    Thanks!

  10. deadhippo
    Member
    Posted 2 years ago #

    Hi,

    Here are all the columns in my adrotate table:

    id, title, bannercode, thetime, updated, author, imagetype, image, link, tracker, timeframe, timeframelenght, timeframeimpressions, type, weight, sortorder

    Alan

  11. deadhippo
    Member
    Posted 2 years ago #

    I'm still getting an error. You can see it in the widget on the right hand side: http://www.theshirtlist.com/interference-t-shirt/

  12. Pedro Menezes Pereira
    Member
    Posted 2 years ago #

  13. deadhippo
    Member
    Posted 2 years ago #

    I don't get the text error on the adrotate widget but I get the the php code on the page. It looks worse.

  14. Arnan de Gans
    Member
    Plugin Author

    Posted 2 years ago #

    I did some digging.

    @ everyone who sees the "Error, no Ad ID set! Check your syntax!" error.

    Look if your location where the advert is expected has the Ad ID configured. This means widgets mainly i think. The *only* way I can find to reproduce this error is if the Ad ID is indeed missing. This is ofcourse an unintentional event but not something AdRotate does by itself.

    @ Everyone seeing the " error: Warning: in_array() expects parameter 2 to be array, null given in [removed]/public_html/wp-content/plugins/adrotate/adrotate-functions.php on line 186" error.

    This error shouldn't been showing if there is a working ad for the location. However, i found that if all ads are expired for that location you can see the error in some cases.

    The fix will be in the next version. For those who do not want to wait for that.

    Add this line to adrotate-functions.php on line 107 (and exactly there):

    $current = array();

    So it's directly below:

    $prefix = $wpdb->prefix;

    Looking like this:

    $prefix = $wpdb->prefix;
    $current = array();

    This will prevent the error from showing.

  15. deadhippo
    Member
    Posted 2 years ago #

    Thanks Arnan. Seems to work. For those who are going to add this line and don't want to count down, you have to place it below the first instance of

    $prefix = $wpdb->prefix;

    There are two instances. Thanks again Arnan. Fast work.

  16. Arnan de Gans
    Member
    Plugin Author

    Posted 2 years ago #

    Yes indeed, after the 2nd instance.
    Use ctrl F or CMD F (mac) to search for the phrase.

    Cleaning up code and removing "unused" lines is not always good it seems :)
    So much for my optimizing effort :(.

    I'll release a proper update soon which also improves error reporting.

  17. yorgict
    Member
    Posted 2 years ago #

    Arnan,

    Thanks for the update but I am unsure what you mean. The error appears on the page where I am adding the Ad. So in other words I go to manage and click add new and nothing happens.

    This is not a widget error rather an error on the page where the image and link is included.

    Thanks
    G

  18. Arnan de Gans
    Member
    Plugin Author

    Posted 2 years ago #

    @yorgict, did you update to 3.7.3.2? Did that solve the issue?

  19. evanw
    Member
    Posted 2 years ago #

    I was also affected with this issue after updating AdRotate. Since I was calling an AdRotate at the top of my page, the PHP error caused my whole site to appear as a blank page.

    Haven't tried the fix yet, will do that asap.

  20. deadhippo
    Member
    Posted 2 years ago #

    Hi Arnan,

    I updated to 3.7.3.2 yesterday but just checked today. While adding:

    $prefix = $wpdb->prefix;

    to 3.7.3.1 seemed to fix it, the new update broke it again. This time I am getting the text error rather than the php code on the page. For both Adrotate widget and text widget with shortcode.

    You can see it here: http://www.theshirtlist.com/batman-vintage-inspired-t-shirt/

    Alan

  21. Arnan de Gans
    Member
    Plugin Author

    Posted 2 years ago #

    That error is only possible if there is no advert found or the ad has been disabled or marked erroneous in the dashboard.

  22. deadhippo
    Member
    Posted 2 years ago #

    The ads have been disabled but am I missing something here? Why should that cause an error?

  23. Arnan de Gans
    Member
    Plugin Author

    Posted 2 years ago #

    Because the AdRotate location tries to load the ad, which is not available.

    Either make sure there are active ads in the location or use a fallback group with a working replacement advert that sells the space. "Your ad here? Call us!".

  24. Arnan de Gans
    Member
    Plugin Author

    Posted 2 years ago #

    @deadhippo: 3.7.3.3 has some changes that will make your errors a bit more discrete.

  25. deadhippo
    Member
    Posted 2 years ago #

    Thanks. That seems to work well. I can't see the error at all.

  26. Arnan de Gans
    Member
    Plugin Author

    Posted 2 years ago #

    If there is an error it shows in html comments. So you can still troubleshoot.

  27. deadhippo
    Member
    Posted 2 years ago #

    Thanks.

  28. pauro
    Member
    Posted 1 year ago #

    I'm using 3.7.4.2, the 'Error, no or no valid AD ID set! Check your syntax!' problem still there. Cannot make new ad new group nor new block. Looks like the problem is because there are No ID's. Strange thing is, works well in my other sites.

  29. pauro
    Member
    Posted 1 year ago #

    got it, uninstall the plugin, delete all ad-rotate instance (table?) from the database, install the plugin, and it works again...

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.