• Resolved Gerdski

    (@gerdski)


    Hello,

    we are updating WordPress and AdRotate, having waited for a long time, but it is necessary now.
    The Update is from Version 3.7.4.2 to the latest Version (5.8.15). We have waited this long to avoid update problems,
    On the Test Site the Update is done, and we see “Error, no Ad ID set! Check your syntax!” where Ads should be.
    In the Backend I see that the Dates for start and Stop of the Ads have gone, they are 01-01-1970 now (although in the overview the Date is correct)

    I have searched on the WordPress Plugin Page and the ajdg.solutions Web Site for answers. Here are some:

    -> The “Error, no Ad ID set! Check your syntax!“ when editing an advert indicates a database issue.

    So, I would like to investigate this issue.

    -> Any errors with the database can be found in your servers error_log file.

    My Provider doesn’t provide the MySQL log file. The PHP Log file is clear of adrotate errors

    -> Try disabling your adblocker

    Did that, no change

    -> Completely uninstall the plugin and start over with a new database from the latest version ?? You’ll loose all AdRotate data, but it saves you from fixing the database.

    I would love to fix the database. How can i do this? What must I do? I am experienced with MySQL

    -> In one of your answers (can’t find the exact statement at the moment) you said something like “update doesn’t work the normal way here, you have to run the update scripts in adrotate-setup.php manually.”

    Can you tell me which scripts to run (in phpMyAdmin)? Maybe it’s not the CREATE stuff, more UPDATE or ALTER TABLE etc.

    Thanks a lot!

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Arnan de Gans

    (@adegans)

    Versions of AdRotate that old can no longer be updated without doing some ‘in-between’ updates.
    For example to version 4.0, 4.18.2, 5.0 and then to the latest version.

    It’s likely the database didn’t update correctly, causing all the issues you have now. That will be logged in the error_log file of your server. Without those errors I can’t tell you exactly what to do.

    However, if you’re handy with MySQL you can match up your database with the install script in adrotate-setup.php and make changes accordingly.
    Of-course make backups of everything before you make any changes. Any such edits are at your own risk.

    Thread Starter Gerdski

    (@gerdski)

    Hello,

    thank you for your answer.

    > It’s likely the database didn’t update correctly, causing all the issues you have now. That will be logged in the error_log file of your server. Without those errors I can’t tell you exactly what to do.

    There is no error_log file that I can get from my provider, unfortunately.

    > However, if you’re handy with MySQL you can match up your database with the install script in adrotate-setup.php and make changes accordingly.
    Of-course make backups of everything before you make any changes. Any such edits are at your own risk.

    I am handy with MySQL. Which script in adrotate-setup.php must I run? There are a few. Is it adrotate_database_upgrade() or adrotate_core_upgrade() or adrotate_clean_setup()…or something else?

    Plugin Author Arnan de Gans

    (@adegans)

    – Right, unfortunately ??

    – You can go through the adrotate_database_upgrade() function and make changes accordingly. But (!!) I find it’s always easier to match up the database with the install scropt. Which is function adrotate_database_install().

    A third and safer option is to roll back (restore a backup) from before the update and do the intermediate update route. On some servers you can do a partial database restore to help with this.
    That way relevant data is migrated over better and often requires less aftercare and troubleshooting if adverts don’t work after updating.

    * Always always make a backup before making changes to the database. Any changes you make are at your own risk.

    Thread Starter Gerdski

    (@gerdski)

    OK, thank you. It works now. Was easy to find the missing columns and why the Update didn’t work:

    Line 585:
    adrotate_add_column(“{$wpdb->prefix}adrotate_schedule”, ‘autodelete’, ‘char(1) NOT NULL default \’N\’ AFTER day_sun‘);

    This wouldn’t be executed because day_sun was not there.

    I had to add 10 Columns to adrotate_schedule to make it work

    daystarttime char(4) NOT NULL default ‘0000’,
    daystoptime char(4) NOT NULL default ‘0000’,
    day_mon char(1) NOT NULL default ‘Y’,
    day_tue char(1) NOT NULL default ‘Y’,
    day_wed char(1) NOT NULL default ‘Y’,
    day_thu char(1) NOT NULL default ‘Y’,
    day_fri char(1) NOT NULL default ‘Y’,
    day_sat char(1) NOT NULL default ‘Y’,
    day_sun char(1) NOT NULL default ‘Y’,
    autodelete char(1) NOT NULL default ‘N’,`

    I think you could easily modify future Versions of adrotate-setup.php with this…so you can avoid answering this silly question over and over again ??

    Plugin Author Arnan de Gans

    (@adegans)

    If done right these things are added automatically during updates.
    So no need to post that anywhere for now.

    But I’ll keep it in mind if others run into the same issue.

    So everything works now?

    Thread Starter Gerdski

    (@gerdski)

    > If done right these things are added automatically during updates.

    But not if the updated version is very old. If the day_sun column is missing in adrotate_schedule the… then the statement adrotate_add_column(“{$wpdb->prefix}adrotate_schedule”, ‘autodelete’, ‘char(1) NOT NULL default \’N\’ AFTER day_sun‘) will fail. I have read about the same error coming after updating a version too old…could it be that these errors come from the same source?

    > So everything works now?

    Things look good now. Thanks for your help!

    Plugin Author Arnan de Gans

    (@adegans)

    Great, let me know if you have further questions. ??

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘“Error, no Ad ID set! Check your syntax!” after Update’ is closed to new replies.