Please read and follow the COMMON ISSUES first!
Always add your version information in every new post! Thank you!

Form2Content Forum

Questions and answers for Form2Content, a Joomla CCK.
  1. Andy Roberts
  2. F2C Search filtered article lists
  3. Tuesday, 29 November 2016
  4.  Subscribe via email
I have found that some of my F2C created articles are appearing twice in my filtered article lists. It turns out that this is because of the way we use joomla Contacts, which on our site are role-based rather than individual-based. A user (the article's author in this case) can be linked to more than one 'contact' if they have multiple roles. This results in multiple records from the join on the content to the contact_details database tables - hence the duplicates.

With the standard joomla category blog, the articles are listed just once as you would expect - the query selects just one (the latest) contact when creating the author link.

Not sure if you count this as a bug or not, but thought it worth posting in case others see duplicate entries in their lists.
Responses (4)
Accepted Answer Pending Moderation
Hi Andy,

I'm not completely following your story. I don't understand the reference to Joomla contacts.

You have a F2C content type
You have defined fields to search on
You have created a filtered list by adding values to one or more of the searchable fields

The result is a list of articles that fulfill the criteria.

You state that articles appear multiple times. I don't understand how this can happen and have never had it happen. Can you explain in more detail? In your description what are the F2C content types and how are the relationships created?

Regards,
Patrick
Please read the F2C documentation before asking questions! Thank you if you've done so ;)
Accepted Answer Pending Moderation
Hi Patrick,

The problem arises with the author who created the article. If they are linked to two or more contacts (the Contacts component allows this), then the F2C SQL select statement that returns the F2C generated articles will return one entry per linked contact record. It doesn't matter what the content type, or search fields are - even the simplest form will produce this scenario. Any F2C articles that have been created by that author are duplicated.

The standard joomla category blog functionality avoids this problem by just selecting one contact record per user (using a 'max' on the id).

Of course this only happens if you are using Contacts the way we are - as roles rather than actual people, and so if a person has more than one role, then you get the duplicates.

Hope that helps!

Andy
Accepted Answer Pending Moderation
Hi Andy,

Thanks I think that clarifies things a bit. I will ask Julien to check the SQL query so this can be avoided. We want to work conform Joomla possibilities, this is just like you say a not so common one.
Did you make a F2C hack already to solve?

Regards,
Patrick
Please read the F2C documentation before asking questions! Thank you if you've done so ;)
Accepted Answer Pending Moderation
Thanks, yes, I did a small hack - we don't show the author so don't need the link. I just return a fixed contactid of 0.
  • Page :
  • 1


There are no replies made for this post yet.
However, you are not allowed to reply to this post.