Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Conversation

@joomdonation
Copy link
Contributor

Pull Request for Issue # .

Summary of Changes

This is a follow PR for #46081. There are few problems with that PR:

  • It introduces some new methods (with different logic) to instead of re-using the same logic which is using everywhere in Joomla to generate new Alias on Save As Copy
  • It does not handle the case Title is changed before As as Copy button is clicked

Testing Instructions

  • Uses Joomla 5.4 nightly build
  • Access to Components -> Smart Search -> Filters and create a new filter if none exists yet
  • Click on a filter to edit, then use Save as Copy button to create a new filter. Make sure the Title and Alias are generated properly like Save as Copy as other places in Joomla (for example, Save as Copy article)

Actual result BEFORE applying this Pull Request

Works, but code is complicated than it should

Expected result AFTER applying this Pull Request

Works, with simpler to maintain code

Link to documentations

Please select:

  • Documentation link for docs.joomla.org:

  • No documentation changes for docs.joomla.org needed

  • Pull Request link for manual.joomla.org:

  • No documentation changes for manual.joomla.org needed

@muhme
Copy link
Contributor

muhme commented Nov 16, 2025

I have tested this item ✅ successfully on 8640a46

Tested with JBT, before PR with nightly build and second timne by applying the PR with Patch Tester
'Save as Copy' is working in creating '* (2)', '* (3)' ... entries, no problems in Joomla logs seen, nothing in PHP log


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

@exlemor
Copy link

exlemor commented Nov 16, 2025

I have tested this item ✅ successfully on 8640a46

I have tested this successfully.

I just want to be specific if the Filter is called:
Filter PR 46449 - Test, it works as expected and you get an alias of filter-pr-46449-test and if you Save as Copy, you then get:
Filter PR 46449 - Test (2), it works as expected and you get an alias of filter-pr-46449-test-2

BUT if you have an Title that ends in a number like:
Filter PR 46449, the alias will be filter-pr-46449 and if you Save as Copy, you then get:
Filter PR 46449 (2), the alias will be filter-pr-46450 and if you do it again, you then get:
Filter PR 46449 (3), the alias will be filter-pr-46451

This happens the same in other areas of Joomla so it is not an issue with this PR, that's why I validated the test.


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

@richard67
Copy link
Member

RTC


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

@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label Nov 16, 2025
@richard67 richard67 added the RMDQ ReleaseManagerDecisionQueue label Nov 16, 2025
@charlotteaa2
Copy link

so good


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

$task = $app->getInput()->get('task', '', 'cmd');
if ($this->getState('task') === 'save2copy') {
$table = $this->getTable();
$table->load(Factory::getApplication()->getInput()->getInt('filter_id', 0));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The filter_id id should be passed from the controller's save function to here as there is the input object available.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@laoneo For that, we should find a way to handle it in save method of FormController https://github.com/joomla/joomla-cms/blob/5.4-dev/libraries/src/MVC/Controller/FormController.php#L575 instead of having to do that in every controller. As this is a bug fix release, I don't want to touch the our MVC code.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. I can do that. But it is just a workaround. Later (in 6.1 for example), we might decide to pass ID of the source the record uses a state variable instead of via $data array, and in that case, we will need to update the code here again.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is not a workaround, the controller is where you should deal with user input.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know. But as I said, we should find a way to handle it in FormController so that we have to pass that data in each child controller.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Anyway, I will stop doing change until we have a final decision. Look like maintainers want to revert the original PR and fix/handle it properly in 6.1

@joomdonation
Copy link
Contributor Author

I'm closing this PR because maintainers decided to revert the original PR and implement a better/proper solution for 6.1

@joomla-cms-bot joomla-cms-bot removed the RTC This Pull Request is Ready To Commit label Nov 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug PR-5.4-dev RMDQ ReleaseManagerDecisionQueue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.