? Failure

User tests: Successful: Unsuccessful:

avatar itbra
itbra
26 Feb 2014

Fixing issue described in bug #33348, related to JModelAdmin (libraries/legacy/model/admin.php)

When trying to publish an item, the related table might be(en) checked out by another user. Thus, publishing will fail silently, since the table is going to try to check in only if is not checked out at all or if the user trying to check it in equals the one having checked it out. If they mismatch nothing is stated to the user trying to change its state, which is no good. So i added a check for this circumstance.

avatar clubnite clubnite - open - 26 Feb 2014
avatar clubnite clubnite - change - 26 Feb 2014
The description was changed
Description <p>When trying to publish an item, the related table might be(en) checked out by another user. Thus, publishing will fail silently, since the table is going to try to check in only if is not checked out at all or if the user trying to check it in equals the one having checked it out. If they mismatch nothing is stated to the user trying to change its state, which is no good. So i added a check for this circumstance.</p> <p>When trying to publish an item, the related table might be(en) checked out by another user. Thus, publishing will fail silently, since the table is going to try to check in only if is not checked out at all or if the user trying to check it in equals the one having checked it out. If they mismatch nothing is stated to the user trying to change its state, which is no good. So i added a check for this circumstance.</p> <p>Find the related TrackerItem at <a href="http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&amp;tracker_id=8103&amp;tracker_item_id=33348">joomlacode.org</a></p>
avatar brianteeman brianteeman - change - 26 Feb 2014
Labels
avatar itbra itbra - change - 26 Feb 2014
Labels Added: ?
avatar nicksavov nicksavov - change - 21 Aug 2014
Labels Removed: ?
avatar nicksavov nicksavov - change - 21 Aug 2014
Labels
avatar brianteeman brianteeman - change - 21 Aug 2014
Status New Pending
avatar brianteeman brianteeman - change - 2 Sep 2014
Category Libraries
avatar jissues-bot jissues-bot - change - 17 Oct 2014
Title
[#33348] fix JModelAdmin::publish()
fix JModelAdmin::publish()
avatar brianteeman brianteeman - change - 17 Oct 2014
Title
[#33348] fix JModelAdmin::publish()
fix JModelAdmin::publish()
avatar itbra itbra - change - 3 May 2015
Title
fix JModelAdmin::publish()
[#33348] fix JModelAdmin::publish()
avatar joomla-cms-bot joomla-cms-bot - change - 3 May 2015
Title
fix JModelAdmin::publish()
[#33348] fix JModelAdmin::publish()
avatar roland-d
roland-d - comment - 4 May 2015

@itbra Could you please update the PR so it is up-to-date. I did a quick test with manual code change and it works for me and is a good fix. Thanks.

avatar roland-d roland-d - change - 4 May 2015
Status Pending Information Required
avatar itbra
itbra - comment - 4 May 2015

I can do that, but i'm afraid it makes no sense as it seems there is no further interest to accept and merge it. See how old it is.

avatar zero-24
zero-24 - comment - 4 May 2015

@itbra I have just also tested as @roland-d per manual code change and it works here too. So the only thing for RTC/merge is now is a up-to-date PR. :smile:

avatar roland-d
roland-d - comment - 4 May 2015

Agree, once the PR is up-to-date I will merge it as we have 2 good tests. Thanks @itbra

avatar itbra
itbra - comment - 4 May 2015

Ok, so i'll close this PR and create a new one as i don't know how to update this one against the latest Joomla! version here on GitHub and creating a new one is the fastest way for me. I create all my PRs directly on GitHub.

avatar itbra
itbra - comment - 5 May 2015

Guys i need your opinions!

When i started to create the new PR i noticed that JModelAdmin::reorder() and JModelAdmin::saveorder() also change an item's state not considering that it might be checked out by a different user. As i think every change to an item's state while it might be checked out by a different user should be checked for this conflict i wonder if it wouldn't be better to extend JModelAdmin::canEditState() rather than introducing code duplication.

I don't want to create the new PR with duplicate code but would like to update all methods that appear to be buggy like JModelAdmin::publish() regarding the editor mismatch.

What do you think?

avatar roland-d
roland-d - comment - 6 May 2015

@itbra I agree with your comment that the checked out status should be taken into account of the reorder/saveorder actions.

However I think we should fix it a little higher up in the chain. If you look at JTable::published() we have the checked out check there as well. This code:

// Determine if there is checkin support for the table.
if (property_exists($this, 'checked_out') || property_exists($this, 'checked_out_time'))
{
    $query->where('(' . $this->getColumnAlias('checked_out') . ' = 0 OR ' . $this->getColumnAlias('checked_out') . ' = ' . (int) $userId . ')');
    $checkin = true;
}
else
{
    $checkin = false;
}

Not sure if we can/should wrap this into a method of it's own. You are setting 2 values here and it is only a single if/else block. Using this block in the existing methods might be just as effective as you don't have to juggle with parameters and return values.

That is my idea.

avatar RonakParmar
RonakParmar - comment - 16 Feb 2016

I have checked this issue in my local, able to reproduce the issue of changing the state of checked item.
Here is my system information:

Joomla! Version: Joomla! 3.4.8 Stable [ Ember ] 24-December-2015 19:30 GMT
Joomla! Platform Version: Joomla Platform 13.1.0 Stable [ Curiosity ] 24-Apr-2013 00:00 GMT
PHP Version: 5.4.45-3+deb.sury.org~precise+1
System Linux desktop 3.5.0-54-generic #81~precise1-Ubuntu SMP Tue Jul 15 04:02:22 UTC 2014 x86_64


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

avatar RonakParmar RonakParmar - test_item - 16 Feb 2016 - Tested successfully
avatar RonakParmar
RonakParmar - comment - 16 Feb 2016

I have tested this item :white_check_mark: successfully on 61cca9a

I have applied this patch and it works fine for me.


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

avatar yvesh yvesh - test_item - 9 Apr 2016 - Tested successfully
avatar yvesh
yvesh - comment - 9 Apr 2016

I have tested this item :white_check_mark: successfully on 61cca9a

Works fine


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

avatar rdeutz rdeutz - change - 9 Apr 2016
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - change - 9 Apr 2016
Labels Removed: ?
avatar rdeutz rdeutz - change - 9 Apr 2016
Labels Added: ?
avatar rdeutz rdeutz - change - 9 Apr 2016
Labels
avatar joomla-cms-bot joomla-cms-bot - change - 9 Apr 2016
Labels Removed: ?
avatar brianteeman
brianteeman - comment - 9 Apr 2016

@rdeutz if you want to make something RTC you have to make a comment RTC at the same time or the bot will unset it


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

avatar brianteeman
brianteeman - comment - 9 Apr 2016

Also not 100% certain but if it fails the travis tests it probably cant be marked RTC either


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

avatar mbabker
mbabker - comment - 9 Apr 2016

It shouldn't be RTC/merged with Travis failures, no. There's extra whitespace on the new line 929 (should be a blank line). The rest of the failures come from the fact this PR is based on such an old version of staging that the Travis config at the time is no longer valid.

avatar rdeutz rdeutz - change - 9 Apr 2016
Labels Added: ?
avatar rdeutz
rdeutz - comment - 9 Apr 2016

I think I will remake the PR or @itbra can you make a new PR?


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

avatar rdeutz rdeutz - change - 9 Apr 2016
Labels
avatar joomla-cms-bot joomla-cms-bot - change - 9 Apr 2016
Labels Removed: ?
avatar rdeutz rdeutz - change - 9 Apr 2016
Labels Added: ?
avatar rdeutz rdeutz - change - 9 Apr 2016
Labels
avatar rdeutz
rdeutz - comment - 9 Apr 2016

Setting to RTC


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

avatar joomla-cms-bot joomla-cms-bot - change - 9 Apr 2016
Labels Removed: ?
avatar rdeutz
rdeutz - comment - 9 Apr 2016

(headbang) seems it is above my level of knowledge to set something to RTC

avatar rdeutz rdeutz - change - 11 Apr 2016
Status Information Required Ready to Commit
avatar rdeutz
rdeutz - comment - 11 Apr 2016

next try to set to RTC


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

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

Closing here so that #9848 is merged


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

avatar rdeutz
rdeutz - comment - 11 Apr 2016

closing this one because of #9848

avatar rdeutz rdeutz - change - 11 Apr 2016
Status Ready to Commit Closed
Closed_Date 0000-00-00 00:00:00 2016-04-11 11:24:34
Closed_By rdeutz
Labels
avatar rdeutz rdeutz - close - 11 Apr 2016
avatar joomla-cms-bot joomla-cms-bot - close - 11 Apr 2016
avatar joomla-cms-bot joomla-cms-bot - change - 11 Apr 2016
Labels Removed: ?

Add a Comment

Login with GitHub to post a comment