[SOLVED] v2.2.x / v3.0 BETA6b, some fields appear regardless of type assignment

More
9 years 2 days ago - 9 years 1 day ago #54264 by jrodgar
Hi!

Did you solved this already? Because I found something that could be related

Lets see this query github.com/FLEXIcontent/flexicontent-cck...tent.fields.php#L344

I have a custom field that copy a core field. I have it assigned to mytypeA and it appears on mytemplate1. Nowadays, when I´m looking a mytypeB article, the field appears again, why?

If you haven´t solved the social toolbar problem (can´t confirm, I haven´t installed last versions), I think is the same problem. I executed a similar query and got something like
Code:
SELECT fi.name, ftrel.* FROM joom_flexicontent_fields AS fi LEFT JOIN joom_flexicontent_fields_type_relations AS ftrel ON (ftrel.field_id = fi.id) AND ftrel.type_id = 5 WHERE fi.published = 1 GROUP BY fi.id ORDER BY ftrel.ordering, fi.ordering, fi.name
Code:
name, field_id, type_id field1, null, null fieldcorrectlyassigned, 80, 5

So on the fields assigned, it appears "fieldcorrectlyassigned", but also "field1", that is not assigned. Why that nulls? Because is a left join and the "AND ftrel.type_id = 5" criteria is on the "on" clause

If I do instead
Code:
SELECT fi.name, ftrel.* FROM joom_flexicontent_fields AS fi LEFT JOIN joom_flexicontent_fields_type_relations AS ftrel ON (ftrel.field_id = fi.id) WHERE fi.published = 1 AND ftrel.type_id = 5 GROUP BY fi.id ORDER BY ftrel.ordering, fi.ordering, fi.name

The results are
Code:
name, field_id, type_id fieldcorrectlyassigned, 80, 5

More info here: www.tech-recipes.com/rx/47637/inner-and-...clause-vs-on-clause/


What do you think? I´m correct about this? I guess that this normally is not an issue because there are other checks (the templates are differents, have different assignations, have empty values...)

Unless otherwise indicated:
Joomla 3.8.1
Flexicontent 3.2.1.7
Last edit: 9 years 1 day ago by ggppdk.
The following user(s) said Thank You: ggppdk

Please Log in or Create an account to join the conversation.

More
9 years 1 day ago - 9 years 1 day ago #54292 by ggppdk
Hello

thanks , i was suspecting it was a LEFT JOIN,

but then neglected this and never looked at it
- also same effect will be by making LEFT JOIN be a JOIN,
because we do not want fileds that are not assigned to the content type

will commit fix !


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...
Last edit: 9 years 1 day ago by ggppdk.

Please Log in or Create an account to join the conversation.

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.311 seconds
Save
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline