New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix tags being deleted by any batch action and by drap and drop reordering of records #18328

Merged
merged 10 commits into from Oct 23, 2017

Conversation

Projects
None yet
@ggppdk
Contributor

ggppdk commented Oct 13, 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 ?

@ggppdk

This comment has been minimized.

Show comment
Hide comment
@ggppdk

ggppdk Oct 13, 2017

Contributor

This is nasty bug, maybe a 3.8.2 milestone ?

Contributor

ggppdk commented Oct 13, 2017

This is nasty bug, maybe a 3.8.2 milestone ?

@franz-wohlkoenig

This comment has been minimized.

Show comment
Hide comment
@franz-wohlkoenig

franz-wohlkoenig Oct 13, 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.

franz-wohlkoenig commented Oct 13, 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.

@Quy Quy referenced this pull request Oct 13, 2017

Closed

Tags Batch Processing Error #18057

@franz-wohlkoenig

This comment has been minimized.

Show comment
Hide comment
@franz-wohlkoenig

franz-wohlkoenig Oct 13, 2017

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

franz-wohlkoenig commented Oct 13, 2017

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

@wilsonge

This comment has been minimized.

Show comment
Hide comment
@wilsonge
Contributor

wilsonge commented Oct 13, 2017

@ggppdk

This comment has been minimized.

Show comment
Hide comment
@ggppdk

ggppdk Oct 13, 2017

Contributor

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

Contributor

ggppdk commented Oct 13, 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

@alikon

This comment has been minimized.

Show comment
Hide comment
@alikon

alikon Oct 13, 2017

Contributor

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.

Contributor

alikon commented Oct 13, 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.

@alikon

This comment has been minimized.

Show comment
Hide comment
@alikon

alikon Oct 13, 2017

Contributor

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

Contributor

alikon commented Oct 13, 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

@franz-wohlkoenig

This comment has been minimized.

Show comment
Hide comment
@franz-wohlkoenig

franz-wohlkoenig Oct 13, 2017

@alikon is this PR ready for RTC?

franz-wohlkoenig commented Oct 13, 2017

@alikon is this PR ready for RTC?

@alikon

This comment has been minimized.

Show comment
Hide comment
@alikon

alikon Oct 13, 2017

Contributor

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

Contributor

alikon commented Oct 13, 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

@ggppdk

This comment has been minimized.

Show comment
Hide comment
@ggppdk

ggppdk Oct 13, 2017

Contributor

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

Contributor

ggppdk commented Oct 13, 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)

@alikon

This comment has been minimized.

Show comment
Hide comment
@alikon

alikon Oct 13, 2017

Contributor

@ggppdk maybe this one #17834 unvalidate #17739

Contributor

alikon commented Oct 13, 2017

@ggppdk maybe this one #17834 unvalidate #17739

@ggppdk

This comment has been minimized.

Show comment
Hide comment
@ggppdk

ggppdk Oct 13, 2017

Contributor

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

Contributor

ggppdk commented Oct 13, 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

@franz-wohlkoenig

This comment has been minimized.

Show comment
Hide comment
@franz-wohlkoenig

franz-wohlkoenig Oct 13, 2017

RTC after two successful tests.

franz-wohlkoenig commented Oct 13, 2017

RTC after two successful tests.

@joomla-cms-bot joomla-cms-bot added the RTC label Oct 13, 2017

@ggppdk

This comment has been minimized.

Show comment
Hide comment
@ggppdk

ggppdk Oct 14, 2017

Contributor

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

Contributor

ggppdk commented Oct 14, 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 ?

@ggppdk

This comment has been minimized.

Show comment
Hide comment
@ggppdk

ggppdk Oct 15, 2017

Contributor

Added 3 new member variables and documented them,

but now this needs retesting !, no longer RTC !

Contributor

ggppdk commented Oct 15, 2017

Added 3 new member variables and documented them,

but now this needs retesting !, no longer RTC !

@csthomas

This comment has been minimized.

Show comment
Hide comment
@csthomas

csthomas Oct 16, 2017

Contributor

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

Contributor

csthomas commented Oct 16, 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

@ggppdk

This comment has been minimized.

Show comment
Hide comment
@ggppdk

ggppdk Oct 16, 2017

Contributor

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 ?

Contributor

ggppdk commented Oct 16, 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 ?

@laoneo

This comment has been minimized.

Show comment
Hide comment
@laoneo

laoneo Oct 16, 2017

Member

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.

Member

laoneo commented Oct 16, 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.

@csthomas

This comment has been minimized.

Show comment
Hide comment
@csthomas

csthomas Oct 16, 2017

Contributor

$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?

Contributor

csthomas commented Oct 16, 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?

@mbabker

This comment has been minimized.

Show comment
Hide comment
@mbabker

mbabker Oct 16, 2017

Member

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

Member

mbabker commented Oct 16, 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.

@ggppdk

This comment has been minimized.

Show comment
Hide comment
@ggppdk

ggppdk Oct 16, 2017

Contributor

i ll add them back , exactly as before ))

Contributor

ggppdk commented Oct 16, 2017

i ll add them back , exactly as before ))

@ggppdk

This comment has been minimized.

Show comment
Hide comment
@ggppdk

ggppdk Oct 16, 2017

Contributor

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

Contributor

ggppdk commented Oct 16, 2017

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

@Patrickbmccabe

This comment has been minimized.

Show comment
Hide comment
@Patrickbmccabe

Patrickbmccabe Oct 17, 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.

Patrickbmccabe commented Oct 17, 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.

@franz-wohlkoenig

This comment has been minimized.

Show comment
Hide comment
@franz-wohlkoenig

franz-wohlkoenig Oct 17, 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"

franz-wohlkoenig commented Oct 17, 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"
@ggppdk

This comment has been minimized.

Show comment
Hide comment
@ggppdk

ggppdk Oct 17, 2017

Contributor

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

I retested too
Ready to be tested again

Contributor

ggppdk commented Oct 17, 2017

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

I retested too
Ready to be tested again

@ggppdk

This comment has been minimized.

Show comment
Hide comment
@ggppdk

ggppdk Oct 19, 2017

Contributor

@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

Contributor

ggppdk commented Oct 19, 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

@franz-wohlkoenig

This comment has been minimized.

Show comment
Hide comment
@franz-wohlkoenig

franz-wohlkoenig Oct 19, 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.

franz-wohlkoenig commented Oct 19, 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.
@csthomas

This comment has been minimized.

Show comment
Hide comment
@csthomas

csthomas Oct 19, 2017

Contributor

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.

Contributor

csthomas commented Oct 19, 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.

@franz-wohlkoenig

This comment has been minimized.

Show comment
Hide comment
@franz-wohlkoenig

franz-wohlkoenig Oct 20, 2017

RTC after two successful tests.

franz-wohlkoenig commented Oct 20, 2017

RTC after two successful tests.

@joomla-cms-bot joomla-cms-bot added the RTC label Oct 20, 2017

@Pilotnik

This comment has been minimized.

Show comment
Hide comment
@Pilotnik

Pilotnik Oct 23, 2017

It's OK now. Thanks.

Pilotnik commented Oct 23, 2017

It's OK now. Thanks.

@mbabker mbabker added this to the Joomla 3.8.2 milestone Oct 23, 2017

@mbabker mbabker merged commit 4b57947 into joomla:staging Oct 23, 2017

4 of 5 checks passed

continuous-integration/drone/pr this build is pending
Details
JTracker/HumanTestResults Human Test Results: 2 Successful 0 Failed.
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
hound No violations found. Woof!

@joomla-cms-bot joomla-cms-bot removed the RTC label Oct 23, 2017

@barraclm

This comment has been minimized.

Show comment
Hide comment
@barraclm

barraclm Oct 24, 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.

barraclm commented Oct 24, 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.

@Patrickbmccabe

This comment has been minimized.

Show comment
Hide comment
@Patrickbmccabe

Patrickbmccabe Oct 24, 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.

Patrickbmccabe commented Oct 24, 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.

@franz-wohlkoenig

This comment has been minimized.

Show comment
Hide comment
@franz-wohlkoenig

franz-wohlkoenig commented Oct 24, 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.

@ggppdk ggppdk deleted the ggppdk:patch-51 branch Oct 24, 2017

@barraclm

This comment has been minimized.

Show comment
Hide comment
@barraclm

barraclm Oct 24, 2017

Thank you Franz. That is very helpful.

barraclm commented Oct 24, 2017

Thank you Franz. That is very helpful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment