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

FIX Ensure schema data includes attributes #11469

Merged

Conversation

GuySartorelli
Copy link
Member

@GuySartorelli GuySartorelli commented Nov 15, 2024

Includes attributes in getSchemaDataDefaults() (excluding any duplicates and the value attribute, which would have caused problems).

To test

Assuming you have silverstripe/frameworktest installed:

  1. Add this code to the Company class

    public function scaffoldSearchFields($_params = null)
    {
        $fields = parent::scaffoldSearchFields($_params);
        foreach ($fields as $field) {
            if ($field->getName() === 'Name') {
                $field->setAttribute('placeholder', 'this is my placeholder');
            }
        }
        return $fields;
    }
  2. Go to the "Test ModelAdmin" section (/admin/test)

  3. Click the magnifying glass in the top right, then expand "search options" - the "Name" field should have some placeholder text.

Also check that you can set up and use the formfields which were specifically changed.

Issue

@GuySartorelli GuySartorelli force-pushed the pulls/6/schemadata-attributes branch from ffb516e to 2d47076 Compare November 21, 2024 01:03
Copy link
Member

@emteknetnz emteknetnz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested locally, works well

@emteknetnz emteknetnz merged commit b86a48f into silverstripe:6 Nov 24, 2024
12 checks passed
@emteknetnz emteknetnz deleted the pulls/6/schemadata-attributes branch November 24, 2024 21:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants