The first menu item should remain in menu 1 and the copy should be found in menu 2.
Both the first and its copy end up in menu 2.
Joomla 4.1.0
Labels |
Added:
No Code Attached Yet
|
confirmed
Yes, I am also able to reproduce it. can anyone guide me on what to do to solve this issue?
I think the error happens here: https://github.com/joomla/joomla-cms/blob/4.1-dev/administrator/components/com_menus/src/Model/ItemModel.php#L1429
$pk
is detected wrongly:
$pk = (!empty($data['id'])) ? $data['id'] : (int) $this->getState('item.id');
Background:
$data['id']
explicitly to 0
if we're in a save2copy
task.$data['id']
is detected as empty
in the model and $pk
falls back to $this->getState('item.id')
which is the id of the menu item to be copied.Maybe solution:
$pk = (!empty($data['id']) || $data['id'] === 0) ? $data['id'] : (int) $this->getState('item.id');
Maybe solution:
Not tested enough, but it seems to fix the issue for me.
Labels |
Added:
bug
|
yeah! Fantastic this working correctly. I have tested it. could i generate a pr for it?
could i generate a pr for it?
Everybody is allowed to provide a pr for Joomla without asking before. You, too ;-)
It will be reviewed and tested then by others. You can make changes if needed.
could i generate a pr for it?
Everybody is allowed to provide a pr for Joomla without asking before. You, too ;-) It will be reviewed and tested then by others. You can make changes if needed.
okay sure! Thanks for the solution btw :).
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2022-03-29 05:50:07 |
Closed_By | ⇒ | drmenzelit |
Confirmed! Same problem in 4.1.1-rc1
It's a bug.