1

Whilst upgrading a site from EE1 to EE2.5.5 I have been doing a lot of editing the database in Sequel Pro. All of which seems to be working fine so far...

But I'm having a problem with a straightforward channel entries tag to display past entries from a specific channel (id=2) all other channels work, and if I add show_future_entries="yes" to the parameters it works for channel 2 (and shows the future entries).

In my investigations I discovered that in the exp_channels table the row for channel_id 2 has a 0 for total_entries and last_entry_date but there are 39 rows in exp_channel_data and exp_channel_titles with a channel_id of 2 (and they all match up and have the same number of rows in total).

If I add a new entry in channel 2 the exp_channels table row doesn't update, but does for other channels.

I tried editing the field directly in Sequel Pro to add the correct total_entries and last_entry_date. But when I post a new entry in channel 2 it reverts those 2 fields to 0.

Update: I just tried adding another new entry and it is updating the entry count now and channel entries tag queries show the new entries with a date before now, but still don't show the older ones.

It seems to be the the older entries in the channel that I inserted directly (along with titles in the exp_titles table) didn't update the exp_channels table and that's the problem. Why it should matter I can't work out, as there aren't any fields in there that are related to entries.

So does anyone know what other table is updated when you add a new entry that is breaking the relationship?

I realise that I must have screwed something up during my time editing the database directly but is there a way to re-synch the exp_channel table and why is this issue preventing the display of past entries?

2
  • update statistics? (under tools, data)
    – GDmac
    Mar 5, 2013 at 19:49
  • That didn't have any effect
    – Paul Frost
    Mar 5, 2013 at 21:25

2 Answers 2

1

Paul, you could try a debug tool like: http://devot-ee.com/add-ons/ee-debug-toolbar It could point you in the right direction.

Did you try any direct calls (not using ee) to the db? If so, is the data returned cleanly?

2
  • I tried this query and it did retrieve older entries than today: {exp:query sql="SELECT field_id_2, entry_id FROM exp_channel_data WHERE channel_id = '2' ORDER BY entry_id DESC LIMIT 15"} {entry_id}:{field_id_2}<br /> {/exp:query}
    – Paul Frost
    Mar 5, 2013 at 21:27
  • It seems to be the the older entries in the channel that I inserted directly (along with titles in the exp_titles table) didn't update the exp_channels table and that's a problem. Why it should matter I can't work out, as there aren't any fields in there that are related to entries.
    – Paul Frost
    Mar 5, 2013 at 21:53
0

After re-checking the database tables again I noticed that the older entries had an expiration date set. Not sure show, as they haven't been used before, so must have happened during the direct database editing. So changed them all to 0 and they are now showing up. So that is what was blocking them.

I didn't see the expiration date in the control panel entry page as I'd already hidden it to stop people using it.

But the exp_channels table is still showing only 4 entries (the new ones I've created during testing) and not the 42 that are in the the exp_channel_data table with and channel_id of 2. Is this likely to be any issue in the future?

1
  • good that you've found it. Most of the time i move those type of "should not use fields" to an options tab, and mention that those are for administrators only :-)
    – GDmac
    Mar 6, 2013 at 8:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.