Skip to content

Inconsistent Duplicate Page Folder Name Handling #191

@thekenshow

Description

@thekenshow

I ran into this in the Admin with a custom page type created via the Add menu. I don't want the user to see or choose a folder name, it should be generated from the title. But if there's an existing folder that matches the autogenerated title folder, I don't want the user having to figure out which folders have been created and which haven't. The solution is to detect an existing folder and append a "-2" (for example) so the page addition creation never fails.

Problem

The flex-objects controller has dedup logic for taskCopy() (via findFirstAvailable()), but the continuePages() method that handles "create new page" just throws an error on duplicates. It's an inconsistency — copy handles it gracefully, create doesn't.

Solution

Adding the same findFirstAvailable() logic to continuePages(). It's a small change that benefits anyone using add_modals with auto-generated slugs.

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