Thank you for all your help.
When creating a new page, the maximum value of the menu index is based on the number of contents existing in the same hierarchy, but it is assumed that the menu index starts from 0.
For the case where the menuindex does not start from 0, shouldn't it be set to the maximum value of the menu index + 1?
|
if($modx->config['auto_menuindex']) { |
|
$pid = (int)$_REQUEST['pid']; |
|
$rs = $modx->db->select('count(*)', $tbl_site_content, "parent='{$pid}'"); |
|
$content['menuindex'] = $modx->db->getValue($rs); |
|
} else { |
L140
$rs = $modx->db->select('max(menuindex)+1', $tbl_site_content, "parent='{$pid}'");
Thank you for all your help.
When creating a new page, the maximum value of the menu index is based on the number of contents existing in the same hierarchy, but it is assumed that the menu index starts from 0.
For the case where the menuindex does not start from 0, shouldn't it be set to the maximum value of the menu index + 1?
evolution/manager/actions/mutate_content.dynamic.php
Lines 138 to 142 in 8d72f3b
L140
$rs = $modx->db->select('max(menuindex)+1', $tbl_site_content, "parent='{$pid}'");