Support » Plugin: St-Daily-Tip » Tip does not display – appears to reset day for next year (2015) prior to EOD

  • TonyNelson

    (@tonynelson)


    I have this set up so that a different tip will display for each day of the year.

    Tip displays fine. Then when the date changes it does not show up. When I go into the Daily Tip to view the tip that should be displaying it states that it has already been displayed and has changed the date to next be displayed in 2015. If I manually edit the date back to 2014 the tip will display for that day. However, this process then repeats the next day.

    Any idea what is going wrong and what I can do to fix it?

    Tony

    https://wordpress.org/plugins/st-daily-tip/

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

    (@jaseparlo)

    No consolation but we’re having the same problem – tip was scheduled for 2014-03-19. I checked it this morning (19 march here) and it says 2015-03-19 and isn’t showing on the site

    jaseparlo

    (@jaseparlo)

    More info – if I edit the display_date field directly through MySQL, and then load the web page, the daily tip doesn’t display and the display_date is changed to 2015 again. Do it through WP-admin and it stays fixed after that.

    It’s like something is borking the update query that sets the last shown date – Tony, did you import your data through CSV? We did. I suspect that the CSV import process isn’t sanitising the data properly, but the HTML form submit is doing that.

    jaseparlo

    (@jaseparlo)

    OK I think I’ve found it. The imported data has a space in the Display_Yearly field, that doesn’t appear in the manually edited rows.

    I exported it as a CSV and noticed – a row that didn’t work looks like
    “13”,”2014-02-01″,NULL,”On Monday it will be <b>Day A</b> on our Timetable”,”TIP”,” “,”2015-03-15″,”2014-03-14″,”7”

    A row that does work looks like
    “17”,”2014-02-01″,NULL,”Today is <b>DAY C</b> on our Timetable”,”TIP”,,”2014-03-19″,”2014-03-18″,”4″

    Likewise if I do
    SELECT length(Display_Yearly) FROM wp_dailytipdata
    I get:
    0
    1
    1
    1
    1
    0
    0

    etc

    I ran
    UPDATE wp_dailytipdata SET Display_Yearly = “”
    on the database, will report back tomorrow to confirm this fixed it

    Thread Starter TonyNelson

    (@tonynelson)

    Yes. I imported my data via CSV. Right now I have turned off the option to display yearly. Manually re-loading the information via CSV for the next year. Please let me know if your fix works…

    Hi Tony

    Watched it for a few days now, that fix has worked. Not sure how to fix the CSV file to ensure it doesn’t happen, we don’t need to import ours again till July so I’ll have a play then if the Dev hasn’t responded to this post by then

    Plugin Author Dhara Shah

    (@dharashah)

    Hi There,

    Sorry that I couldn’t be in the conversation before this.

    First Of all, I have kept the Logic to change the Display Date to Next Year. The complete logic is as follows:
    1. At time of selecting the tip to be displayed today, the plugin first looks up the Last Shown Date. If the Last Shown Date is Today, then it means that the tip is already selected and that tip is to be displayed.
    2. If there is no tip shown today, then a tip is to be selected. For this the first priority is given to display date. If display date is set to today, it is shown , its last shown date is set. Also if it is set to repeat yearly, its display date is set to next year date.

    This should not create a problem due to 1. logic.

    However, i did notice 2 problems
    1. Plugin was checking the Display_Yearly as not null. Instead this is now corrected to check “Display_Yearly = ‘on'”.
    2. The shown date was being set to server time. This should have been the Local Time Set in Word Press. This too is corrected in version 2.0 I have just uploaded

    Hope this solves your problem.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Tip does not display – appears to reset day for next year (2015) prior to EOD’ is closed to new replies.