? ? Pending

User tests: Successful: Unsuccessful:

avatar alikon
alikon
27 Apr 2019

follow up #24730.

Summary of Changes

copy permission when Batch copy items to a new category

Testing Instructions

  • Create an article.
  • Go to its permission tab and make a change. (e.g registered->allow creating)
  • Go to Batch and Copy it somewhere else.

Expected result

the permission are copyied

Actual result

permission are not copied

avatar alikon alikon - open - 27 Apr 2019
avatar alikon alikon - change - 27 Apr 2019
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 27 Apr 2019
Category Libraries
avatar alikon alikon - change - 27 Apr 2019
Title
copy permission too
Batch copy: copy permission too
avatar alikon alikon - edited - 27 Apr 2019
avatar richard67
richard67 - comment - 27 Apr 2019

I have tested this item āœ… successfully on c72d6f2

I've tested with 2 articles which had differenc ACL modifications.
Both articles copied in 1 batch action.
Before patch: Copied articles have ACL like in new articles.
After patch: Each of the article copies has ACL like the particular copy source article.

@HLeithner and @wilsonge Release leads please check as also with PR #24730 if this is a bug fix so it goes into 3.9.next or a new feature for 4.0.


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

avatar richard67
richard67 - comment - 27 Apr 2019

I have tested this item āœ… successfully on c72d6f2

I've tested with 2 articles which had differenc ACL modifications.
Both articles copied in 1 batch action.
Before patch: Copied articles have ACL like in new articles.
After patch: Each of the article copies has ACL like the particular copy source article.

@HLeithner and @wilsonge Release leads please check as also with PR #24730 if this is a bug fix so it goes into 3.9.next or a new feature for 4.0.


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

avatar richard67 richard67 - test_item - 27 Apr 2019 - Tested successfully
avatar viocassel
viocassel - comment - 27 Apr 2019

I have tested this item āœ… successfully on c72d6f2


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

avatar viocassel viocassel - test_item - 27 Apr 2019 - Tested successfully
avatar franz-wohlkoenig franz-wohlkoenig - change - 27 Apr 2019
Status Pending Ready to Commit
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 27 Apr 2019

Status "Ready To Commit".

avatar wilsonge
wilsonge - comment - 27 Apr 2019

I'm not unhappy to call this a bug fix - but what happens if there isn't a entry in the permissions table for the asset - shouldn't we check in JTable that there actually is a asset_id for items

avatar infograf768
infograf768 - comment - 27 Apr 2019

I agree, for this one, with @wilsonge
I guess we may not need that check for categories and modules.

avatar wilsonge
wilsonge - comment - 27 Apr 2019

Agreed. The stuff that's component specific is fine. But this generic one needs more careful sanity checks

avatar alikon
alikon - comment - 28 Apr 2019

not so sure what "sanity check" you are talking about if target and/or source asset don't exists the query simply does nothing

avatar alikon alikon - change - 28 Apr 2019
Labels Added: ?
avatar infograf768
infograf768 - comment - 28 Apr 2019

I guess just making sure there is an existing asset for the original item.

if ($oldAssetId)

query
avatar roland-d roland-d - change - 18 May 2019
Labels Added: ?
avatar infograf768 infograf768 - change - 5 Jun 2019
Labels Removed: ?
avatar infograf768
infograf768 - comment - 5 Jun 2019

@wilsonge
the rtc label has been taken off without a reply to @alikon
Please explain further what you expect to get this in.

e2f6555 5 Jun 2019 avatar alikon cs
avatar alikon alikon - change - 5 Jun 2019
Labels Added: ?
avatar HLeithner
HLeithner - comment - 5 Jun 2019

I removed it because George requested more sanity checks, I'm also not sure if this is a bugfix because permission copying is missing or a new feature.

Atm I think it's a bugfix but ymmv.

avatar alikon
alikon - comment - 5 Jun 2019

for sanity check i've already answered #24736 (comment)
šŸ˜•

avatar HLeithner
HLeithner - comment - 5 Jun 2019

@wilsonge could you please elaborate your comment?

avatar wilsonge
wilsonge - comment - 7 Jun 2019

Inside JTable we check for asset support based on the asset id field being present

// If we are tracking assets, make sure an access field exists and initially set the default.
if (property_exists($this, 'asset_id'))
{
$this->_trackAssets = true;
}

we need something similar in the model so that we know if the item actually has an asset or not because right now we're just going to blindly try and clone assets even for items that don't have assets

avatar alikon
alikon - comment - 8 Jun 2019

did you mean something like $this->table->hasField($this->table->getColumnAlias('asset_id'))
?

avatar wilsonge
wilsonge - comment - 9 Jun 2019

Something like that yes

avatar infograf768 infograf768 - change - 9 Jun 2019
Status Ready to Commit Pending
Labels
avatar infograf768
infograf768 - comment - 9 Jun 2019

Back to pending until change.


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

avatar alikon alikon - change - 10 Jun 2019
Labels Removed: ?
avatar alikon
alikon - comment - 10 Jun 2019

change made, please check, retest

avatar richard67
richard67 - comment - 10 Jun 2019

I'll wait for the travis and appveyor and drone results, then test. Am already preparing.

avatar richard67
richard67 - comment - 10 Jun 2019

@alikon I get this after having applied your patch on a current staging, clean new install with testing sample datas, using patchtester to apply it:
Unbenannt

avatar alikon
alikon - comment - 10 Jun 2019

yes you're right hasField() was introduced in 4.x backported to 3.x now

avatar richard67
richard67 - comment - 10 Jun 2019

@alikon Now there is no error, and the articles are copied, but the permissions not.

avatar richard67
richard67 - comment - 10 Jun 2019

@alikon Sorry, forget previous comment. My mistake.

avatar richard67
richard67 - comment - 10 Jun 2019

@alikon Hmm, now after having applied the patch, when batch copying 2 articles, only permissions of 1st article are copied.

avatar richard67
richard67 - comment - 10 Jun 2019

@alikon Sorry, again my mistake. all ok.

avatar richard67
richard67 - comment - 10 Jun 2019

I have tested this item āœ… successfully on c0fbbeb


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

avatar richard67
richard67 - comment - 10 Jun 2019

I have tested this item āœ… successfully on c0fbbeb


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

avatar richard67 richard67 - test_item - 10 Jun 2019 - Tested successfully
avatar richard67
richard67 - comment - 10 Jun 2019

I have tested this item āœ… successfully on 7b6861a


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

avatar richard67
richard67 - comment - 10 Jun 2019

I have tested this item āœ… successfully on 7b6861a


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

avatar richard67 richard67 - test_item - 10 Jun 2019 - Tested successfully
avatar Quy
Quy - comment - 10 Jun 2019

In PHP error log when batching banners.

PHP Notice: Undefined property: BannersTableBanner::$asset_id in \joomla-cms-staging\libraries\src\MVC\Model\AdminModel.php on line 439

avatar richard67
richard67 - comment - 10 Jun 2019

In PHP error log when batching banners.

PHP Notice: Undefined property: BannersTableBanner::$asset_id in \joomla-cms-staging\libraries\src\MVC\Model\AdminModel.php on line 439

Confirmed.

avatar richard67
richard67 - comment - 10 Jun 2019

I have not tested this item.


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

avatar richard67
richard67 - comment - 10 Jun 2019

I have not tested this item.


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

avatar richard67 richard67 - test_item - 10 Jun 2019 - Not tested
avatar Quy
Quy - comment - 17 Jun 2019

I have tested this item āœ… successfully on 49226ba


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

avatar Quy Quy - test_item - 17 Jun 2019 - Tested successfully
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 18 Jun 2019

@richard67 can you please retest?

avatar richard67
richard67 - comment - 18 Jun 2019

@franz-wohlkoenig As soon as I have cooked and eaten I will re-test.

avatar richard67
richard67 - comment - 18 Jun 2019

I have tested this item āœ… successfully on 49226ba

1. Permissions are copied.
2. No "PHP Notice: Undefined property ..." anymore when batch copying banners.


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

avatar richard67
richard67 - comment - 18 Jun 2019

I have tested this item āœ… successfully on 49226ba

1. Permissions are copied.
2. No "PHP Notice: Undefined property ..." anymore when batch copying banners.


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

avatar richard67 richard67 - test_item - 18 Jun 2019 - Tested successfully
avatar richard67
richard67 - comment - 18 Jun 2019
avatar franz-wohlkoenig franz-wohlkoenig - change - 18 Jun 2019
Status Pending Ready to Commit
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 18 Jun 2019

Status "Ready To Commit".

avatar wilsonge
wilsonge - comment - 15 Jul 2019

@alikon can you please do the cleanup i mentioned

avatar Quy
Quy - comment - 15 Jul 2019

@wilsonge I did PR #51 as you suggested, but had to revert with PR #52 due to a warning that I can't remember at the moment.

avatar alikon alikon - change - 15 Jul 2019
Labels Added: ?
avatar alikon
alikon - comment - 16 Jul 2019

@wilsonge to me the only thing which i can think about is to move

if ($this->table->hasField($this->table->getColumnAlias('asset_id')))

outside i.e before the while cause we are always referring to the same table.....
but $oldAssetId must be stored before $this->table->asset_id is changed by this->table->store()

or i missunderstand you

avatar HLeithner
HLeithner - comment - 20 Jul 2019

@wilsonge can you comment on this before I merge it?

avatar wilsonge
wilsonge - comment - 22 Jul 2019

Basically what @Quy did in https://github.com/alikon/joomla-cms/pull/51/files is what Iā€™m after - it makes more sense if we can make it work. Can we find out why that was failing?

avatar alikon alikon - change - 3 Aug 2019
Status Ready to Commit Closed
Closed_Date 0000-00-00 00:00:00 2019-08-03 10:11:04
Closed_By alikon
avatar alikon alikon - close - 3 Aug 2019
avatar richard67
richard67 - comment - 3 Aug 2019

@alikon why closing this?

avatar richard67
richard67 - comment - 3 Aug 2019

@alikon Did you maybe accidently hit the wrong button, close instead of rebase?

avatar alikon
alikon - comment - 4 Aug 2019

i've had 5 minutes of "send all to the hell" feeling...
...a little bit better now

avatar alikon alikon - change - 4 Aug 2019
Status Closed New
Closed_Date 2019-08-03 10:11:04
Closed_By alikon
Labels Removed: ?
avatar alikon alikon - change - 4 Aug 2019
Status New Pending
avatar alikon alikon - reopen - 4 Aug 2019
avatar richard67
richard67 - comment - 4 Aug 2019

@wilsonge The syntax for the join, does the fix for the "ON" which you have done in J4 here a18322d apply also to J3? If so, it should be also fixed here in this PR. I will then make PR for Nicola's branch but want you to confirm if that would be right.

avatar richard67
richard67 - comment - 4 Aug 2019

@wilsonge I just see according to J3 database api doc my previous comment for you is wrong, i.e. this PR here is ok with "... ON ... " in 1 join condition. Is that right?

Regarding your sanity check, Nicola has merged noth PRs from @Quy so now it should be ok. Maybe reason why moving things down did not work is because the $this->table->get('id'); would be before that then and reset stuff somehow?

avatar alikon
alikon - comment - 6 Aug 2019

@HLeithner cause i'm not too much able to read only & fully understand code
i've made a test with your suggestion applyied ...... as a result permission are not copyied

so may I ask you to do the same test?
with your suggestion and without (only this silly pr)
........maybe you'll can confirm or deny my results

avatar richard67
richard67 - comment - 7 Aug 2019

@Quy That was what I supposed, too, but seems that comment in code reviews was too hidden.

avatar richard67
richard67 - comment - 7 Aug 2019

Tonight I can test again. But last changes were code style only so my old test should still be ok.

avatar richard67
richard67 - comment - 7 Aug 2019

I have tested this item āœ… successfully on 6b24187


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

avatar richard67
richard67 - comment - 7 Aug 2019

I have tested this item āœ… successfully on 6b24187


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

avatar richard67 richard67 - test_item - 7 Aug 2019 - Tested successfully
avatar richard67
richard67 - comment - 7 Aug 2019

@viocassel or @Quy could you test again? Thanks in advance.

avatar viocassel
viocassel - comment - 7 Aug 2019

I have tested this item āœ… successfully on 6b24187


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

avatar viocassel
viocassel - comment - 7 Aug 2019

I have tested this item āœ… successfully on 6b24187


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

avatar viocassel viocassel - test_item - 7 Aug 2019 - Tested successfully
avatar richard67
richard67 - comment - 7 Aug 2019

@viocassel Thanks for testing.

avatar franz-wohlkoenig franz-wohlkoenig - change - 7 Aug 2019
Status Pending Ready to Commit
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 7 Aug 2019

Status "Ready To Commit".

avatar infograf768 infograf768 - change - 8 Aug 2019
Labels Added: ?
avatar HLeithner
HLeithner - comment - 8 Aug 2019

Thank you for your engagement in Joomla!

avatar HLeithner HLeithner - change - 8 Aug 2019
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2019-08-08 11:21:07
Closed_By HLeithner
avatar HLeithner HLeithner - close - 8 Aug 2019
avatar HLeithner HLeithner - merge - 8 Aug 2019

Add a Comment

Login with GitHub to post a comment