Skip to content

Menu Index value when create new document #1680

@ogumemura

Description

@ogumemura

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}'");

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions