Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Categories categorisableMultiSelection choice per registered property name #1222

Open
ThiloWitt opened this issue Mar 29, 2019 · 4 comments
Open
Assignees
Milestone

Comments

@ThiloWitt
Copy link

Q A
ModuleStudio Version [1.4.0]
Operating System [Windows]
Zikula Target in Model [ZK20]
Zikula Version [2.0.x]
PHP Version [7.0.x]

Summary
MOST allows to active categorisableMultiSelection per entity = all categories of an entity show either the single or the multi selection feature. When more than one category properties are registered for a module in Categories / category registry, some of them might need to work with SingleSelection, which is not possible in the current situation.

Desired Behavior
Allow to chose between single and multi selection per category property.

Possible Solution
Move the option categorisableMultiSelection to the category registry of the Categories module

@Guite Guite added this to the Future milestone Mar 29, 2019
@Guite
Copy link
Owner

Guite commented Mar 31, 2019

Note: the generated CategoryHelper already provides a hasMultipleSelection method which allows to decide for each entity and property/registry whether multi selection should be possible or not.

@ThiloWitt
Copy link
Author

I see "public function hasMultipleSelection" in AbstractCategoryHelper.php. I would need an example of how a "Subclass can override this method to apply a custom behaviour to certain category registries"

@Guite
Copy link
Owner

Guite commented Apr 1, 2019

I'll first need to verify that this is properly considered at all places, e.g. quick navigation form type and other form types.

@Guite
Copy link
Owner

Guite commented May 27, 2019

Example for overriding the method:

public function hasMultipleSelection($objectType = '', $registry = '')
{
    if ('person' === $objectType) {
        return 'MySpecial' === $registry;
    }

    return parent::hasMultipleSelection($objectType, $registry);
}

This would enable the multi selection for the MySpecial registry, but not for other ones registered for the same entity (person).

But it won't work at all places yet, because there are some more changes required in the form classes and/or the categories form type in the core.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants