? Success

User tests: Successful: Unsuccessful:

avatar nn-medienagentur
nn-medienagentur
15 Apr 2015

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

avatar nn-medienagentur nn-medienagentur - open - 15 Apr 2015
avatar joomla-cms-bot joomla-cms-bot - change - 15 Apr 2015
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - change - 15 Apr 2015
Labels Added: ?
avatar Bakual
Bakual - comment - 15 Apr 2015

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('*') . ')'

avatar phproberto
phproberto - comment - 16 Apr 2015

Also please add the information to reproduce the issue and test the patch.

avatar joomdonation
joomdonation - comment - 17 Apr 2015

Seems there are still something wrong with the PR (based on code review):

  1. 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.

  2. 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('*') . ')');
}
avatar joomdonation
joomdonation - comment - 17 Apr 2015

Made a PR at nn-medienagentur#1 . In case we agree with this change @nn-medienagentur can merge the PR to save time.

avatar zero-24 zero-24 - change - 29 Apr 2015
Category Front End SQL
avatar zero-24 zero-24 - change - 29 Apr 2015
Status Pending Information Required
avatar zero-24
zero-24 - comment - 29 Apr 2015

Moving to Information required until @nn-medienagentur have a look into here. Thanks :smile:


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6784.

avatar nn-medienagentur
nn-medienagentur - comment - 30 Apr 2015

@joomdonation you're right. I have tested it, and it work great with IN and remove created_by in if clause, thanks.

avatar brianteeman
brianteeman - comment - 24 May 2015

Removed Information Required tag


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6784.

avatar brianteeman brianteeman - change - 24 May 2015
Status Information Required Pending
avatar designbengel
designbengel - comment - 9 Jun 2015

So.... How to test it :-)


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6784.

avatar infograf768
infograf768 - comment - 11 Jun 2015

@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.

avatar designbengel
designbengel - comment - 11 Jun 2015

@infograf768 i tested like you described the issue but can´t reproduce it.
Steps:

  • Created two Users (User 1, User 2) Both have language set to "All"
  • Created an Article with Language Set to "all" for User 2
  • Created two Articles for User 1 (en-GB, de-DE)
  • Created a Menüitem for Displaying Contact for User 1 (Show Articles is marked) -> The Show Articles Slide only shows the articles of user 1 After deleting the two Articles from User 1 the slide is not visible anymore.

~ Any other instructions, did i miss something ?


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6784.

avatar brianteeman brianteeman - alter_testresult - 7 Apr 2016 - infograf768: Tested successfully
avatar mikeveeckmans
mikeveeckmans - comment - 15 Apr 2016

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


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6784.

avatar brianteeman brianteeman - change - 15 Apr 2016
Status Pending Information Required
avatar brianteeman
brianteeman - comment - 15 Apr 2016

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


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6784.

avatar nn-medienagentur
nn-medienagentur - comment - 16 Apr 2016

Here is the description to reproduce the issue.

  1. create a User1
  2. create a User2
  3. create a article like "User1 Language ALL" and select created_by the User1 Language ALL
  4. create a article like "User2 Language UK" and select created_by the User2 Language en-GB
  5. create a Contact "User2" and liked the Contact with User2 Language ALL
  6. Add a new MenuItem from type Contacts - > Single contact add select the User2 and change in "Contact Display Options" -> Show User Article to "show" language for the Menu can be ALL
  7. IMPORTANT now you have do enable the Plugin "System - Language Filter"

Now you see on the Frontend in the Single Contact View the Article from User 1


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6784.

avatar mikeveeckmans mikeveeckmans - test_item - 18 Apr 2016 - Tested successfully
avatar mikeveeckmans
mikeveeckmans - comment - 18 Apr 2016

I have tested this item :white_check_mark: successfully on 47cc301

Tested again with new instructions.
Now i could reproduce the error and test patch.
TEST OK


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6784.

avatar brianteeman brianteeman - change - 18 Apr 2016
Status Information Required Ready to Commit
avatar brianteeman
brianteeman - comment - 18 Apr 2016

Rtc


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6784.

avatar joomla-cms-bot joomla-cms-bot - change - 18 Apr 2016
Labels Added: ?
avatar joomla-cms-bot
joomla-cms-bot - comment - 18 Apr 2016

This PR has received new commits.

CC: @infograf768, @mikeveeckmans


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6784.

avatar mikeveeckmans
mikeveeckmans - comment - 18 Apr 2016

@nn-medienagentur what are the changes?


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6784.

avatar nn-medienagentur
nn-medienagentur - comment - 18 Apr 2016

@mikeveeckmans nothing, why are you asking?

avatar rdeutz rdeutz - change - 18 Apr 2016
Milestone Added:
avatar rdeutz
rdeutz - comment - 18 Apr 2016

Just one comment before I merge this, I check what is faster "or" vs. "in" and it seems that "in" is faster.

avatar rdeutz rdeutz - reference | 34ba66c - 18 Apr 16
avatar rdeutz rdeutz - merge - 18 Apr 2016
avatar rdeutz rdeutz - close - 18 Apr 2016
avatar rdeutz rdeutz - close - 18 Apr 2016
avatar rdeutz rdeutz - merge - 18 Apr 2016
avatar joomla-cms-bot joomla-cms-bot - close - 18 Apr 2016
avatar rdeutz rdeutz - change - 18 Apr 2016
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
avatar joomla-cms-bot joomla-cms-bot - change - 18 Apr 2016
Labels Removed: ?
avatar rdeutz rdeutz - change - 1 May 2016
Milestone Removed:
avatar rdeutz rdeutz - change - 1 May 2016
Milestone Added:
avatar rdeutz rdeutz - change - 1 May 2016
Milestone Added:
avatar rdeutz rdeutz - change - 1 May 2016
Milestone Removed:

Add a Comment

Login with GitHub to post a comment