? ? Pending

User tests: Successful: Unsuccessful:

avatar ggppdk
ggppdk
13 Oct 2017

Pull Request for Issues #18317 and #18086 and #18057

Summary of Changes

The tags are not retrieved properly by the code of AdminModel class
(by the batch actions methods and saveorder() method)

This is to due wrongly calculated 'tableClassName'
(when the descendant of this class is namespaced ?)
which results in empty UCM type & typeAlias, thus tags do not get loaded

There was common code (same code) called in 6 places

  • batch() method
  • 4 batch*() methods
  • saveorder() method

Fixed the code and moved it into a new method , initBatch()
(saveorder() needed some more fixing that the others)

Testing Instructions

Use batch actions and manual reordering of records

Expected result

The above task work properly
and they also do not delete the tags assigned to the articles

Actual result

The tags are deleted

Documentation Changes Required

initBatch() method added

Should this be protected or private ?

Votes

# of Users Experiencing Issue
1/1
Average Importance Score
5.00

avatar joomla-cms-bot joomla-cms-bot - change - 13 Oct 2017
Category Libraries
avatar ggppdk ggppdk - open - 13 Oct 2017
avatar ggppdk ggppdk - change - 13 Oct 2017
Status New Pending
avatar ggppdk ggppdk - change - 13 Oct 2017
The description was changed
avatar ggppdk ggppdk - edited - 13 Oct 2017
avatar ggppdk ggppdk - change - 13 Oct 2017
The description was changed
avatar ggppdk ggppdk - edited - 13 Oct 2017
avatar ggppdk ggppdk - change - 13 Oct 2017
The description was changed
avatar ggppdk ggppdk - edited - 13 Oct 2017
avatar ggppdk ggppdk - change - 13 Oct 2017
The description was changed
avatar ggppdk ggppdk - edited - 13 Oct 2017
avatar ggppdk ggppdk - change - 13 Oct 2017
The description was changed
avatar ggppdk ggppdk - edited - 13 Oct 2017
avatar ggppdk ggppdk - change - 13 Oct 2017
The description was changed
avatar ggppdk ggppdk - edited - 13 Oct 2017
avatar ggppdk ggppdk - change - 13 Oct 2017
The description was changed
avatar ggppdk ggppdk - edited - 13 Oct 2017
avatar ggppdk ggppdk - change - 13 Oct 2017
The description was changed
avatar ggppdk ggppdk - edited - 13 Oct 2017
avatar ggppdk ggppdk - change - 13 Oct 2017
The description was changed
avatar ggppdk ggppdk - edited - 13 Oct 2017
avatar ggppdk ggppdk - change - 13 Oct 2017
The description was changed
avatar ggppdk ggppdk - edited - 13 Oct 2017
avatar ggppdk ggppdk - change - 13 Oct 2017
The description was changed
avatar ggppdk ggppdk - edited - 13 Oct 2017
avatar ggppdk ggppdk - change - 13 Oct 2017
The description was changed
avatar ggppdk ggppdk - edited - 13 Oct 2017
avatar ggppdk
ggppdk - comment - 13 Oct 2017

This is nasty bug, maybe a 3.8.2 milestone ?

avatar ggppdk ggppdk - change - 13 Oct 2017
The description was changed
avatar ggppdk ggppdk - edited - 13 Oct 2017
avatar franz-wohlkoenig franz-wohlkoenig - test_item - 13 Oct 2017 - Tested successfully
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 13 Oct 2017

I have tested this item successfully on caf8b82


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

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 13 Oct 2017

@ggppdk i guess this PR works only for com_content (not joomla-extensions/weblinks#368)

avatar wilsonge
wilsonge - comment - 13 Oct 2017
avatar ggppdk
ggppdk - comment - 13 Oct 2017

i guess this PR works only for com_content (not joomla-extensions/weblinks#368)

@franz-wohlkoenig

This PR is a valid fix for all classes that extend ModelAdmin and face this issue,
I have tested just now with weblinks 3.7.0-beta1 and it is working

avatar alikon alikon - test_item - 13 Oct 2017 - Tested successfully
avatar alikon
alikon - comment - 13 Oct 2017

I have tested this item successfully on caf8b82


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

avatar alikon
alikon - comment - 13 Oct 2017

but i'm afraid we still have some issues about classname and TagsObserver

old $tagsObserver = $table->getObserverOfClass('\JTableObserverTags');
new $tagsObserver = $table->getObserverOfClass('Joomla\CMS\Table\Observer\Tags');

that is supposed to be fixed by #17739

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 13 Oct 2017

@alikon is this PR ready for RTC?

avatar ggppdk ggppdk - change - 13 Oct 2017
Labels Added: ?
avatar alikon
alikon - comment - 13 Oct 2017

i would say yes cause it fix a big issue
but i suspect that there is still some issue with #18328 (comment) under the hood

so i'm afraid we need some feedback from mantainers
perhaps setting RTC gain more priority

avatar ggppdk
ggppdk - comment - 13 Oct 2017

@alikon

yes it was supposed to have been fixed, as you said above,
but it seems that fix was incomplete

foreach (JLoader::getDeprecatedAliases() as $alias)

https://github.com/joomla/joomla-cms/blob/staging/libraries/joomla/observer/updater.php#L63

will return 'jtableobservertags' which is not equal to 'JTableObserverTags'

thus this does not work

$this->table->getObserverOfClass('\JTableObserverTags');

(the slash is not the issue, lowercase comparison to uppercase is the issue)

avatar alikon
alikon - comment - 13 Oct 2017

@ggppdk maybe this one #17834 unvalidate #17739

avatar ggppdk
ggppdk - comment - 13 Oct 2017

The fixing of loading of classes via alias, regardless of letter case of the alias
will not effect this PR, and it should be done seperately of this PR

In this PR we just use the full qualified name of the class

This PR can be RTC

avatar franz-wohlkoenig franz-wohlkoenig - change - 13 Oct 2017
Status Pending Ready to Commit
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 13 Oct 2017

RTC after two successful tests.

avatar ggppdk ggppdk - change - 13 Oct 2017
Labels Added: ?
avatar ggppdk ggppdk - change - 14 Oct 2017
The description was changed
avatar ggppdk ggppdk - edited - 14 Oct 2017
avatar ggppdk
ggppdk - comment - 14 Oct 2017

@mbabker , @wilsonge

This is an important bug-fix of issues (of not uncommon usage) resulting in data loss (tags deleted)
please review for adding J3.8.2 milestone, and maybe reviewing the PR too

see brianteeman comment here also saying that this is urgent,
#18317 (comment)

aka if this, can be fixed properly then it should be in J3.8.2 ?

avatar ggppdk
ggppdk - comment - 15 Oct 2017

Added 3 new member variables and documented them,

but now this needs retesting !, no longer RTC !

avatar franz-wohlkoenig franz-wohlkoenig - change - 16 Oct 2017
Status Ready to Commit Pending
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 16 Oct 2017

Status in Issue Tracker back on "Pending".

avatar laoneo
laoneo - comment - 16 Oct 2017

Are the three new global member variables used on other places as well or only for batch? If not then for me this can lead to confusion to have global member variables which are used only for a set of operations.

avatar ggppdk
ggppdk - comment - 16 Oct 2017

@laoneo

Are the three new global member variables used on other places as well or only for batch? If not then for me this can lead to confusion to have global member variables which are used only for a set of operations.

They are used for batch*() and for saveorder(), should i add this at the comments above their definitions ?

please note that
-- these are not new they already existed before this PR
-- their usage is now documented, before it was not

avatar laoneo
laoneo - comment - 16 Oct 2017

So if I call first batch* and then saveorder will it still work?

avatar ggppdk ggppdk - change - 16 Oct 2017
Labels Removed: ?
avatar ggppdk
ggppdk - comment - 16 Oct 2017

So if I call first batch* and then saveorder will it still work?

Yes all methods call batchInit() to populate the re-usable member variables

please note that the code regarding populating

$this->table
$this->type
$this->tagsObserver

existed before this PR,
just because same code was repeated 5 times, i moved it to seperate method

question
these member variables were not documeted before

now i have renamed $this->batchSet to $this->batchInitialized
and removed $this->user and $this->tableClassName

is it a B/C break , should i restore them ?

avatar csthomas
csthomas - comment - 16 Oct 2017

May be you can use $this->table === null instead variable $this->batchInitialized === null?

avatar csthomas
csthomas - comment - 16 Oct 2017

now i have renamed $this->batchSet to $this->batchInitialized
and removed $this->user and $this->tableClassName

is it a B/C break , should i restore them ?

They have not been documented, I do not think so

avatar ggppdk
ggppdk - comment - 16 Oct 2017

May be you can use $this->table === null instead variable $this->batchInitialized === null?

yes my thought too,

just if some derived class decides to set $this->table in the constructor, then initBatch will not initialize the other member variables because $this->table === null will not be true

should i do this change ?

avatar laoneo
laoneo - comment - 16 Oct 2017

is it a B/C break , should i restore them ?

If they have been not private then it can be counted as a BC break.

avatar csthomas
csthomas - comment - 16 Oct 2017

$this->user was used by protected function checkCategoryId(). As there can be more batch methods in subclasses then all old variables probably has to stay initialised as before, some of them could be mark as deprecated.

3rd party component may use one of that variable which is not documented above.
Does Joomla support B/C for such variables?

avatar mbabker
mbabker - comment - 16 Oct 2017

$this->foo when not declared on a class object is treated as a public variable. So, there is a case to be made that removing the use of undeclared class variables counts as a B/C break because the variables were implicitly created through certain code paths.

avatar ggppdk
ggppdk - comment - 16 Oct 2017

i ll add them back , exactly as before ))

avatar ggppdk
ggppdk - comment - 16 Oct 2017

I have restored class member variables, now it should be B/C
Now it can be re-tested

avatar Patrickbmccabe
Patrickbmccabe - comment - 17 Oct 2017

I have this issue. (Please forgive my ignorance) How do I take part in a test ?


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

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 17 Oct 2017

@Patrickbmccabe please mark your Test as successfully:

  • open Issue Tracker
  • Login with your github-Account
  • Click on blue "Test this"-Button above Authors-Picture
  • mark your Test as successfully
  • hit "submit test result"
avatar ggppdk
ggppdk - comment - 17 Oct 2017

Done i restored 1 more local variable as member property (as pointed out by @csthomas )

I retested too
Ready to be tested again

avatar ggppdk
ggppdk - comment - 19 Oct 2017

@Puckmeister
@franz-wohlkoenig
@rgblogs
@Pilotnik
@Fuchsritter
@cybersalt
@AndySDH
@Shazrina1994

you had reported having issues with the tags being lost

maybe you can test this PR

avatar franz-wohlkoenig franz-wohlkoenig - test_item - 19 Oct 2017 - Tested successfully
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 19 Oct 2017

I have tested this item successfully on 88fec66

Darg-and-Drop-Reordering works also as Batch-Action; Test on Articles.

Thanks @ggppdk


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/18328.
avatar csthomas csthomas - test_item - 19 Oct 2017 - Tested successfully
avatar csthomas
csthomas - comment - 19 Oct 2017

I have tested this item successfully on 88fec66

Tested #18317, #18086 and #18057


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

avatar franz-wohlkoenig franz-wohlkoenig - change - 20 Oct 2017
Status Pending Ready to Commit
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 20 Oct 2017

RTC after two successful tests.

avatar Pilotnik
Pilotnik - comment - 23 Oct 2017

It's OK now. Thanks.

avatar mbabker mbabker - change - 23 Oct 2017
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2017-10-23 23:25:26
Closed_By mbabker
Labels Added: ?
avatar mbabker mbabker - close - 23 Oct 2017
avatar mbabker mbabker - merge - 23 Oct 2017
avatar barraclm
barraclm - comment - 24 Oct 2017

I would love to test this, but I am but a humble user, one of thousands, probably tens or even hundreds of thousands who uses Joomla to manage web sites. It may be 'fixed' for geeks, but for us lesser mortals it remains a MAJOR bug until an update appears in the update channel. Does anyone know when we might expect this?


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

avatar Patrickbmccabe
Patrickbmccabe - comment - 24 Oct 2017

I agree with Barraclm, I would love to give my time amd effort to this, but it is beyond my ability. This bug has caused major issue for a Library website I had created 100's of tags for.


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

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 24 Oct 2017

@barraclm https://github.com/joomla/joomla-cms/milestones - there you find expected Release Date.
@Patrickbmccabe https://docs.joomla.org/Bug_Tracking_Process - Information about Bug tracking using Patchtester.

avatar barraclm
barraclm - comment - 24 Oct 2017

Thank you Franz. That is very helpful.

Add a Comment

Login with GitHub to post a comment