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::setDisableFunction() has no visual or functional affect #1688

Open
2 tasks done
UndefinedOffset opened this issue Feb 22, 2024 · 0 comments
Open
2 tasks done

Comments

@UndefinedOffset
Copy link

Module version(s) affected

2.1.17

Description

TreeDropdownField::setDisableFunction() has no visual or functionality affects in at least 2.1.17 (but likely in 2.0 as well), where as in 1.13.22 the options are faded and not clickable. In 1.13.22 this appears like the below:
dropdown-example

Note in 1.13 this will properly allow selection at any depth.

How to reproduce

To Reproduce create a Test Page type for example:

class TestPage extends Page {}

Then seed a mix of page types in the page tree including at least one TestPage at any depth and add a TreeDropdownField to another object that has a disable function that simply checks to see if the incoming page is an instance of TestPage.

TreeDropdownField::create('TargetPageID', 'Target Page', SiteTree::class)
    ->setDisableFunction(function (SiteTree $page) {
        return !is_a($page, TestPage::class);
    }),

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)
@UndefinedOffset UndefinedOffset changed the title TreeDropdownField::setDisableFunction() has no visual affect TreeDropdownField::setDisableFunction() has no visual or functional affect Feb 27, 2024
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