Wrong entry_id being saved for relationship
Posted: 29 October 2007 01:35 PM   [ Ignore ]  
Lab Assistant
RankRank
Total Posts:  115
Joined  10-31-2006

One of my weblogs has a relationship with another weblog (which is in a different site). When I submit a value for this relationship using the dropdown menu, a (seemingly) unrelated integer is stored in the database. Yet somehow when I reload the Edit form, the correct item is selected in the dropdown menu.

I’m totally baffled.

So, in the Edit form, I’m seeing:

<select name='field_id_73' class='select'>
<
option value='124' selected='selected' dir='ltr' >Robert Mitchell</option>
...(
more options)...
</
select>

And when I submit that form, what actually gets stored in MySQL is a row that looks like this:

entry_id: 104
field_id_73
: 742 # WTF?

What’s more, it seems that each time I submit the Edit form, the integer stored in field_id_73 for that entry increments by some arbitrary amount. Just now it went from 742 to 745.

Help, please! My production deadline in is 2 hours.

Best,
Ben

Profile
 
 
Posted: 29 October 2007 01:36 PM   [ Ignore ]   [ # 1 ]  
Lab Assistant
RankRank
Total Posts:  115
Joined  10-31-2006

Er, I should add that the problem, of course, is that I can’t fetch related_entries using this ID, because the value of the ID in the database is wrong, even though it’s correct in the Edit form.

Profile
 
 
Posted: 29 October 2007 01:38 PM   [ Ignore ]   [ # 2 ]  
Lab Assistant
RankRank
Total Posts:  115
Joined  10-31-2006

Also, it seems that the value always increments by 3.

Profile
 
 
Posted: 29 October 2007 01:40 PM   [ Ignore ]   [ # 3 ]  
Moderator
Avatar
RankRankRankRankRankRankRankRank
Total Posts:  32910
Joined  05-14-2004

Hi, Ben - what version and build of EE are you running, and are you running any extensions?

 Signature 
Profile
MSG
 
 
Posted: 29 October 2007 01:43 PM   [ Ignore ]   [ # 4 ]  
Lab Assistant
RankRank
Total Posts:  115
Joined  10-31-2006

Hey Lisa. Sorry for not including this. I’m running 1.6.0 build 20070918.

It looks like my diagnosis was off; field_id_73 appears to hold the ID of the relationship record, not the entry_id of the related record. So that’s as it should be. But I’m still unable to pull related data using the field.

It’s especially odd because all my other relationships are working properly.

Thanks,
Ben

Profile
 
 
Posted: 29 October 2007 01:50 PM   [ Ignore ]   [ # 5 ]  
Lab Assistant
RankRank
Total Posts:  115
Joined  10-31-2006

A clue!

This does not work:

{if eventgroup_speaker}
{related_entries id
="eventgroup_speaker"}
<p><strong>Seminar Director:</strong> {speaker_bio}</p>
{/related_entries}
{
/if}

This does work:

{if eventgroup_speaker}
{related_entries id
="eventgroup_speaker"}
<p><strong>Seminar Director:</strong> {field_id_72}</p>
{/related_entries}
{
/if}

I tried that after looking in the cached relationship data in the relationships table and seeing that the field names weren’t set in there.

Cheers,
Ben

P.S. I’ve tried resetting my relationship caches from the control panel already. No dice.

Profile
 
 
Posted: 29 October 2007 03:45 PM   [ Ignore ]   [ # 6 ]  
Administrator
Avatar
RankRankRankRankRankRankRank
Total Posts:  15845
Joined  06-03-2002

Ben, is it possible to email (not PM) me Super Admin and FTP access so I can step through and troubleshoot where in the code it’s breaking down?

 Signature 
Profile
MSG
 
 
Posted: 29 October 2007 03:52 PM   [ Ignore ]   [ # 7 ]  
Lab Assistant
RankRank
Total Posts:  115
Joined  10-31-2006
Derek Jones - 29 October 2007 03:45 PM

Ben, is it possible to email (not PM) me Super Admin and FTP access so I can step through and troubleshoot where in the code it’s breaking down?

I can do Super Admin and phpMyAdmin, but I don’t think I can do FTP, at least not without more consideration. Would that help, or do you need to fiddle with source files directly?

Thanks!
Ben

Profile
 
 
Posted: 29 October 2007 04:01 PM   [ Ignore ]   [ # 8 ]  
Administrator
Avatar
RankRankRankRankRankRankRank
Total Posts:  15845
Joined  06-03-2002

I’d absolutely need FTP, as I cannot break out of the code with debugging information unless I have access to the source.  Cruising as a Super Admin through the templates and content might reveal something, but it’s not likely, and would take much more time since I have no familiarity with your weblogs, custom fields, templates, etc.  But obviously it is your prerogative; just offering the fastest avenue since you are on a time crunch.

 Signature 
Profile
MSG
 
 
Posted: 29 October 2007 05:01 PM   [ Ignore ]   [ # 9 ]  
Administrator
Avatar
RankRankRankRankRankRankRank
Total Posts:  15845
Joined  06-03-2002

Ben, as your deadline has come and gone, I hope you found a solution for your launch.  Let me know how I can assist from here.  Also, as one of Lisa’s earlier questions might still be relevant, are you running any extensions?

 Signature 
Profile
MSG
 
 
Posted: 30 October 2007 08:55 AM   [ Ignore ]   [ # 10 ]  
Lab Assistant
RankRank
Total Posts:  115
Joined  10-31-2006

Thanks Derek. Yes, for launch, we just used {field_id_nn} in place of the field name inside the {related_entries} tag pair. I still hope to get you source access, just not sure it will be possible because of our infrastructure.

I’m not running any extensions, though I am running one 3rd party module (User, from SolSpace) and one custom plugin of my own design. That plugin, which handles user registration for seminars, is only invoked on one template, which isn’t involved in this problem (I assume).

Oh—I’m also running the patch you sent me earlier this month for the member import respecting email nonuniqueness! I forgot about that. So it’s not straight 20070918.

In the exp_relationships table, should rel_data hold field names and values, or column names and values? I’m assuming the latter, since that’s what appears in the relationships I have that are working, too. That is to say,

s:11:"field_id_26";s:61:"The season will close with..."

as opposed to

s:17:"event_description";s:61:"The season will close with..."

Cheers,
Ben

Profile
 
 
Posted: 30 October 2007 09:04 AM   [ Ignore ]   [ # 11 ]  
Administrator
Avatar
RankRankRankRankRankRankRank
Total Posts:  15845
Joined  06-03-2002

Yes, it holds the column name, not the variable’s short name.  The match-up all occurs behind the scenes in the Weblog module.  I know you guys have a tight ship there with regard to external access, so that’s understandable.  If you can set me up with a Super Admin account, I can create an access restricted test template and try some back end troubleshooting.  To expedite the process, you can go ahead and create that test template, doing so as a copy of the problem template.

 Signature 
Profile
MSG
 
 
Posted: 30 October 2007 09:26 AM   [ Ignore ]   [ # 12 ]  
Lab Assistant
RankRank
Total Posts:  115
Joined  10-31-2006

Cool. I’ve just sent you an email with credentials.

Thanks!
Ben

Profile
 
 
Posted: 30 October 2007 03:24 PM   [ Ignore ]   [ # 13 ]  
Lab Assistant
RankRank
Total Posts:  115
Joined  10-31-2006

Followup: this issue is resolved. My problem (in case it helps future generations of hackers) was that I’d broken my database content by running a custom SQL query to update exp_weblog_titles with a new site_id for a batch of entries without also updating exp_weblog_data with the same site_id.

Or, from a different perspective, my problem was that I’d hacked around in the database without a comprehensive understanding of the EE schema.

At any rate, many thanks to Derek for going to a lot of trouble for what was, in the end, not his problem at all.

Cheers!
Ben

Profile
 
 
   
 
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 1149, on July 16, 2007 09:33 AM
Total Registered Members: 65024 Total Logged-in Users: 40
Total Topics: 82111 Total Anonymous Users: 24
Total Replies: 441286 Total Guests: 186
Total Posts: 523397    
Members ( View Memberlist )