symphonycms / members

Members extension for Symphony
http://symphonyextensions.com/extensions/members/
Other
65 stars 38 forks source link

include count in associated sections throw error #120

Closed hypnosis closed 13 years ago

hypnosis commented 13 years ago

I check 'Include a count of entries in associated sections' in my datasource with member section

and in devKit i see this error node:

  <my-profile>
    <section id="11" handle="user">User</section>
    <error>MySQL Error (1054): Unknown column 'relation_id' in 'where clause' in query "SELECT SQL_CACHE count(*) AS `count` FROM `sym_entries_data_55` WHERE `relation_id` = '13'"</error>
 </my-profile>
brendo commented 13 years ago

Can you post the included elements for that datasource including their field types

hypnosis commented 13 years ago

There is no included element for that datasource

Email -> Member: Email
Password -> Member: Password
First -> Text Input
Last name -> Text Input
Role -> Member: Role
Userpic -> File Upload
Photo -> File Upload
Country -> Text Input
City -> Text Input
Blog name -> Text Input
Driving experience -> Text Input
About me -> Textarea

Other sections has selectBoxLink to Users -> Email link

Blog Section:

User field: SelectBoxLink -> User: email field

Car Section:

User field: SelectBoxLink -> User: email field

Blog Section: User field: SelectBoxLink -> User: email field

Comment Section:

User field: SelectBoxLink -> User: email field
Blog field: SelectBoxLink -> Blog: title field
brendo commented 13 years ago

Ok so it's just a blank datasource with no filters, sorting or pagination, but the 'Include a count of entries in associated sections' checkbox checked.

I'll take a look :)

hypnosis commented 13 years ago

Yes it's so! It is a test case for extension which falls for me. Try to add/remove fields in other sections, where Members section is associated for and you get this bug not only in outputed xml, but in backend, when you want to list members and look count linked sections.

brendo commented 13 years ago

Sorry, I can't reproduce this bug on my installation.

I've got my Members section with a Member: Email field.

I've create two other sections (Test A, Test B) with a Text Input field and then Select Box Link field that links to my Member: Email field. I've create a coupled of entries and linked them to various Member entries. I then created two datasources, one on the Members section, one of the Test A section that just have the associated counts checkbox ticked.

When I view the XML I get the correct response.

The backend also has no errors, just the correct data (the count of related entries). Clicking on the number takes me to the filtered list of entries by this Member entry.

I've also tried the reverse, adding the SBL field on the Members section and pointing it the Text Input field in Test A, no errors here either.

I've deleted the Text Input field that was used for linking, no errors.

I've deleted the related entries on both sides (in Members and Test A), no errors.

Is there anything unusual about this setup?

hypnosis commented 13 years ago

This is right test case... I think this bug in not Members extensions, but in symphony cms. This issue can be closed, i try to catch this bug in other sections and in other ways. My project start with symphony 2.2 integration verstion and upgraded to 2.2.1 - stable release

I start use integration members version and upgrade every 2 days to nightly integration versions. This bug can be evaluated after upgrades, and manually fix data base structure problem, if that appears

brendo commented 13 years ago

Out of curiosity, what type of field belongs to sym_entries_data_55?

hypnosis commented 13 years ago

sym_entries_data_55 contains id, entry_id, role_id and there is not any relation_id colimn.