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

TreeDropdownField -> DisableFunction not working #11208

Closed
2 tasks done
icecaster opened this issue Apr 26, 2024 · 7 comments
Closed
2 tasks done

TreeDropdownField -> DisableFunction not working #11208

icecaster opened this issue Apr 26, 2024 · 7 comments

Comments

@icecaster
Copy link
Contributor

icecaster commented Apr 26, 2024

Module version(s) affected

5

Description

TreeDropdownField & its subclasses (TreeMultiselectField)->DisableFunction not working

How to reproduce

This code should produce a dropdown field of all groups, none should be selectable:

$fields->addFieldToTab(
    "Root.Main",
    TreeMultiselectField::create("Test", "Test")
    ->setDisableFunction(function ($node) {
        return true;
    }
));

Possible Solution

No response

Additional Context

No response

Validations

  • Check that there isn't already an issue that reports the same bug
  • Double check that your reproduction steps work in a fresh installation of silverstripe/installer (with any code examples you've provided)

PRs

@GuySartorelli
Copy link
Member

GuySartorelli commented May 9, 2024

This was fixed as part of bringyourownideas/silverstripe-maintenance#220 - because of the breadth of the changes it won't be tagged until the next minor release.

@GuySartorelli
Copy link
Member

Oops, wrong issue

@GuySartorelli GuySartorelli reopened this May 9, 2024
@maxime-rainville
Copy link
Contributor

Looks like this is a frontend problem. The nodes are marked as disabled in the JSON request.
image

Just seems like the front end doesn't care. Arguably, we should probably have a check to make sure that you get block server side if you pick a disabled option.

@maxime-rainville maxime-rainville added this to the Silverstripe CMS 5.3 milestone May 15, 2024
@priyashantha
Copy link

SilverStripe 5.3 is now released but doesn't seem to be this issue has been resolved yet?

@GuySartorelli
Copy link
Member

GuySartorelli commented Nov 4, 2024

I assume you're looking at the milestone? Milestones are a rough guess and are a guide to help us work on meaningful work. They are not a guarantee of what will be included in any given release.

If fixing this bug is important to you I recommend opening a pull request that fixes it.

@priyashantha
Copy link

@GuySartorelli Did you have any chance to review the PR please?

@GuySartorelli
Copy link
Member

PR merged

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

4 participants