ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Trouble with dates

April 18, 2011 1:52pm

Subscribe [5]
  • #1 / Apr 18, 2011 1:52pm

    marianway

    24 posts

    Hello

    I am having a few problems with dates. I am using v 1.6.9.

    My site lists forthcoming training courses and each instance of a course is called an event.

    First problem is that events keep disappearing, without me touching the template at all. This seems to happen when I create a new event or modify an existing one. Yesterday, I found I can get some of them back, by saving again, but there are still some missing. I don’t think it’s a fault in the template. Any ideas?

    Second problem is that I have some code to output the next event for each course, which works fine for some courses and not others. I have checked the course has a future event associated with it.

    The code is:

    {exp:weblog:entries weblog="courses" entry_id="15" disable="categories|member_data|pagination|trackbacks"}
    {reverse_related_entries weblog="events" show_future_entries="yes" orderby="date" limit="1" sort="asc" disable="categories|pagination|trackbacks"}
    {!-- if the event starts later than now --}
    {if {entry_date format="%U"} > {current_time format="%U"} }
    <div class=“next_event”>
      Course next starts on _ {entry_date format="%d-%M-%Y"}
    </div>
    {/if}
    {/reverse_related_entries}
    {/exp:weblog:entries}

    As I say, this works fine for some courses, so I don’t think there can be an error in the code, but am open to any ideas as to why some events are not showing up and others are! I

    Thank you in advance.

    Marian

    PS I cannot find a relationship between the first and second problems - i.e. it is not the same events that are missing. One that has always shown up on the ‘next event’ page went missing for a week. And one that is showing up on the main events page is missing on the ‘next event’ page.

  • #2 / Apr 19, 2011 6:55am

    John Henry Donovan

    12339 posts

    marianway,

    the {reverse_related_entries} tag only supports six of the typical parameters used by other ExpressionEngine tags and not the show_future_entries= parameter. It will show future dated entries by default

    {reverse_related_entries weblog="default_site" status="open" sort="desc" orderby="title" offset="5" limit="10"}
    
    {/reverse_related_entries}

    Are you using daylight saving?

    What have you set in your Localization Settings
    Admin > System Preferences > Localization Settings

  • #3 / Apr 20, 2011 12:37pm

    marianway

    24 posts

    Hi John

    Thank you for your help. I have removed the show_future_entries parameter, but it hasn’t made any difference.

    The Localisation settings are:

    GMT
    -
    European
    Yes (daylight saving)
    Yes (honour daylight saving)

    If you have any more ideas, I would be very grateful. I cannot see why the code works in one place and not another.

    Marian

  • #4 / Apr 21, 2011 1:21pm

    Sue Crocker

    26054 posts

    First problem is that events keep disappearing, without me touching the template at all. This seems to happen when I create a new event or modify an existing one. Yesterday, I found I can get some of them back, by saving again, but there are still some missing. I don’t think it’s a fault in the template. Any ideas?

    Hi, Marianway. Are the events changing when you edit? Would it be possible to have you upgrade to EE 1.7.1, which is the most recent version.

    BTW: You will still need show_future_entries, otherwise items in the future won’t show correctly.

    Our goal is to get the simplest part of the exp:weblog:entries to fire and then work on the stuff inside it.

  • #5 / Apr 22, 2011 2:25pm

    marianway

    24 posts

    Thanks Sue.

    I have done loads of experiments and discovered that if I use the same code in the same place with a different entry_id it works fine. So I have compared all the entries in the two weblogs (courses and in events) and all the relevant fields have been completed in the same way, so cannot find any reason why the code will not work for one course and not another. Could this be a bug?

    Another problem I have is that someone else installed EE for me and I am afraid I don’t know how to back up or how to upgrade. I know I need to sort this out so maybe now is the time to do that. If you could point me to some clear instructions on how to do that, that would be useful.

    Thank you!

    Marian

  • #6 / Apr 22, 2011 3:47pm

    Brandon Jones

    5500 posts

    Hi Marian,

    Here are the upgrade instructions for EE 1.x. Backing up first is definitely recommended, but how you do this depends on your server and how it was set up for you. Typically you’ll have access to an application like phpMyAdmin which will let you select the EE database and export it to a downloadable file. Please keep us posted.

  • #7 / Apr 27, 2011 3:37pm

    marianway

    24 posts

    Hi Brandon

    Thanks for this information. It has taken me a while as I didn’t know anything about backing up databases or whether i was on a unix server and had to find out - but have now gone very carefully through all the steps in the upgrade process - and when I ran the upgrade wizard it said it was successful - but now I have a completely blank screen. I cannot see my site or Expression Engine. Help! Is there something ‘obvious’ which I should be doing?

    Marian

  • #8 / Apr 27, 2011 6:43pm

    Brandon Jones

    5500 posts

    Marian,

    Please enable error reporting and let’s see if we can find a clue as to what’s happening.

  • #9 / Apr 27, 2011 7:35pm

    marianway

    24 posts

    Hi Brandon

    Thank you!

    I cannot see the control panel, but have done the following:

    1. Added to my index.php file: ini_set(‘display_errors’, 1); 
    2. In my index.php file, changed the value of   “error_reporting(0);”  to   “error_reporting(E_ALL);” 
    3. Changed the system/config.php $conf[‘debug’] value to 2

    Not sure what happens next?

    Marian

  • #10 / Apr 28, 2011 3:08am

    marianway

    24 posts

    Hi Brandon

    I have found out why I could not see my control panel / site. I had not loaded the module files back in. I am really sorry about that. No need to look at errors. I will change the above files back.

    And then will investigate to see if the upgrade has had any effect on my original problem. Thank you for your patience!

    Marian

  • #11 / Apr 28, 2011 7:17am

    John Henry Donovan

    12339 posts

    Thanks Marian. Keep us updated.

  • #12 / Apr 30, 2011 10:44am

    marianway

    24 posts

    Thank you all for your help.

    The issue is now resolved although by a bizarre route that seems completely illogical to me…

    There was no change after the upgrade so I started experimenting with the code again. I changed the first line of the code (above) to

    {exp:weblog:entries weblog="courses" disable="categories|member_data|pagination|trackbacks"}

    This had the effect of bringing up the first date of three of the five courses (the same three that worked in my previous experiments with entry_id numbers). There was absolutely no reason why the other two were omitted.

    Then I thought I would test the idea of bringing up ALL the dates of all the courses, so as the first step to this, I pasted the code beneath the original code. I was surpised to see a longer list of entries come up - 10 to be exact, with the five that should be there x 2. In other words the code was now acting as it should despite the fact all I had done was copy it and paste it underneath. ?? When I checked back to the page with the original glitch, that was working too.

    If anyone knows why copying and pasting had this effect, I would love to know! Otherwise, this thread can be closed.

    Thanks again all,

    Marian

  • #13 / Apr 30, 2011 12:54pm

    Greg Salt

    3988 posts

    Hi Marian,

    Thanks for the update and glad that you got this figured out. As for why it happened, it’s difficult to say but because the copy and paste fixed it I would guess that perhaps an unusual control character got mixed into the original code and stopped it working. Please post back if you have further questions or problems.

    Cheers

    Greg

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases