?
Related to # 4721
Referenced as Related to: # 4721
avatar dkanchev
dkanchev
16 Oct 2014

Steps to reproduce the issue

If you use the Module Manager to duplicate an existing module then the system creates the new module item just fine and sets the name of the new module item to "module_name (index_number)". So far so good :) However, if you duplicate the original module item one more time then the next duplicated module item will have the same name as the previous duplicated module item. This is probably confusing so here is the more clear explanation:

  • Let's say that we have a module called "testmodule".
  • If we duplicate it the new module will be called "testmodule (2)"
  • If we duplicate the original "testmodule" again the third module will have the same name - "testmodule (2)"

This is kind of confusing for the end users. It is logical for the third module to have the following name - "testmodule (3)". Actually, this is exactly what happens if we duplicate "testmodule (2)" but most people will use only the original module to create duplicates.

Expected result

  • My opinion is that every duplicated module should have a new unique name and not the same name as another module. This helps people to differentiate the modules - users do not care about unique IDs - they use module names.

Actual result

  • Right now the duplicate function creates new modules with one and the same names.

System information (as much as possible)

CentOS 6
PHP 5.5
MySQL 5.5

More info will be provided if it is needed.

Additional comments

  • None.
avatar dkanchev dkanchev - open - 16 Oct 2014
avatar dkanchev
dkanchev - comment - 16 Oct 2014

Here is a screenshot.screen shot 2014-10-16 at 09 11 39

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

avatar infograf768
infograf768 - comment - 16 Oct 2014

Confirmed

avatar joomdonation
joomdonation - comment - 17 Oct 2014

OK. I made the PR which fixed the issue reported by @dkanchev when duplicate the module. Please help testing it.

@infograf768: What's the expected behavior when "save and copy" ? At the moment, by reading the code, I see that the system wanted to work as follow (but there is bug in the code prevents it from working as expected)
1. If users change title of the module before pressing the button, the new module will be created with new title and it is published by default

  1. If users don't change the title, the system "wants" to use original module title + " Copy" as the title of new module and the module will be unpublished. Right now, the title is not changed because there is bug in the code. So title of the copied module is always the same with original module

Maybe you can let me know the expected behavior and I will make a new PR for copy & save function ?
Tuan

avatar nicksavov nicksavov - change - 17 Oct 2014
Labels Added: ?
avatar zero-24 zero-24 - close - 17 Oct 2014
avatar brianteeman brianteeman - change - 17 Oct 2014
Status New Closed
Rel_Number 4721
Relation Type Related to
avatar jissues-bot jissues-bot - close - 17 Oct 2014
avatar jissues-bot
jissues-bot - comment - 17 Oct 2014
avatar brianteeman
brianteeman - comment - 17 Oct 2014

Please see proposed fix #4721

avatar jissues-bot jissues-bot - change - 17 Oct 2014
Closed_Date 0000-00-00 00:00:00 2014-10-17 06:15:52
avatar joomdonation
joomdonation - comment - 17 Oct 2014

@brianteeman The PR fixes the original issue reported by @dkanchev. However, we have another issue which is reported by @infograf768. I want to hear your feedback of both of you about how it should work so that I can fix it as well (maybe on a new PR). Please refer to my messages earlier:

@infograf768: What's the expected behavior when "save and copy" ? At the moment, by reading the code, I see that the system wanted to work as follow (but there is bug in the code prevents it from working as expected)
1. If users change title of the module before pressing the button, the new module will be created with new title and it is published by default

If users don't change the title, the system "wants" to use original module title + " Copy" as the title of new module and the module will be unpublished. Right now, the title is not changed because there is bug in the code. So title of the copied module is always the same with original module
Maybe you can let me know the expected behavior and I will make a new PR for copy & save function ?

So I think we should re-open this issue again ?

avatar dimitargsg
dimitargsg - comment - 17 Oct 2014

@joomdonation I also tested the "Save as copy" functionality and I think that a new PR should be opened and the issue addressed as the new module was created with the same name as the original one and is directly enabled, which I don't think is a good idea:

http://awesomescreenshot.com/0f53od0odb

avatar joomdonation
joomdonation - comment - 17 Oct 2014

Thanks @dimitargsg. I still waiting for feedback from @brianteeman and @infograf768 to see how we should generate the title of the copied module:

  1. Use Title of the original module + ' Copy' . That's how the original code wanted to do but it has bug.

  2. Or use the format as we do in duplicate Title (2), Title (3)....

Once I heard from them, I will open new PR with the fix.

avatar infograf768
infograf768 - comment - 17 Oct 2014

I have a patch for Save and Copy to make it behave as in 2.5.x i.e. add (copy) to the title and unpublish the module. Will post it. In the mean while, Merging first #4721

avatar joomdonation
joomdonation - comment - 17 Oct 2014

OK. Thanks @infograf768

avatar zero-24 zero-24 - change - 7 Jul 2015
Labels Added: ?

Add a Comment

Login with GitHub to post a comment