User tests: Successful: Unsuccessful:
the where clause must be in brackets, because without brackets the query returns articles that match with language = * without checking the created_by = user_id
Labels |
Added:
?
|
Labels |
Added:
?
|
Also please add the information to reproduce the issue and test the patch.
Seems there are still something wrong with the PR (based on code review):
I think we don't need to have $query->where('a.created_by = ' . (int) $result->user_id) because It is added before already https://github.com/joomla/joomla-cms/blob/staging/components/com_contact/models/contact.php#L381 and I don't see any reasons that only be added if the site is multilingual.
Seems we are using IN clause for language query in other places in core, not using OR. A quick google search also show that IN has better performance in OR. So maybe we should change OR to IN
So the code in the PR could be changed to:
if (JLanguageMultilang::isEnabled())
{
$query->where('a.language IN (' . $db->quote(JFactory::getLanguage()->getTag()) . ',' . $db->quote('*') . ')');
}
Made a PR at nn-medienagentur#1 . In case we agree with this change @nn-medienagentur can merge the PR to save time.
Category | ⇒ | Front End SQL |
Status | Pending | ⇒ | Information Required |
Moving to Information required
until @nn-medienagentur have a look into here. Thanks
@joomdonation you're right. I have tested it, and it work great with IN and remove created_by in if clause, thanks.
Removed Information Required tag
Status | Information Required | ⇒ | Pending |
So.... How to test it :-)
@test
This works fine here.
To test:
Display a contact for USER1 in frontend. "Show User Articles" should be set to "Show" in the menu item. (Don't forget that, in multilanguage, a user/author should have only one contact to which is assigned language 'All' OR one contact for each published Content Language.)
Create an article set to All Languages and assign it to another user (USER2) than the one displayed by the menu item.
That article will be displayed by the menu item in the list of Articles for USER1.
Patch and test again: it will not any more as it does not belong to that user.
@infograf768 i tested like you described the issue but can´t reproduce it.
Steps:
~ Any other instructions, did i miss something ?
Cannot reproduce this error.
Not a multilingual site, nor on a single language site.
used version J!3.5.1
followed the test instructions from @infograf768
Status | Pending | ⇒ | Information Required |
Several people have stated that they cannot reproduce the issue. This could be because it no longer exists and has been solved elsewhere or it is down to the test intructions not being detailed enough.
Please can you check if this is still an issue and update with detailed test instructions or this will be closed in a few weeks.
Thanks
Here is the description to reproduce the issue.
Now you see on the Frontend in the Single Contact View the Article from User 1
I have tested this item successfully on 47cc301
Tested again with new instructions.
Now i could reproduce the error and test patch.
TEST OK
Status | Information Required | ⇒ | Ready to Commit |
Labels |
Added:
?
|
This PR has received new commits.
CC: @infograf768, @mikeveeckmans
@nn-medienagentur what are the changes?
@mikeveeckmans nothing, why are you asking?
Milestone |
Added: |
Just one comment before I merge this, I check what is faster "or" vs. "in" and it seems that "in" is faster.
Status | Ready to Commit | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2016-04-18 13:03:38 |
Closed_By | ⇒ | rdeutz |
Labels |
Removed:
?
|
Milestone |
Removed: |
Milestone |
Added: |
Milestone |
Added: |
Milestone |
Removed: |
Agreed with the fix, but there is a codestyle issue. You need to add a space before the closing bracket:
Change
$db->quote('*') .')'
to$db->quote('*') . ')'