The Wayback Machine - https://web.archive.org/web/20210720032813/https://github.com/statamic/cms/pull/3989
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

Prevent using reserved words as field handles #3989

Conversation

@arthurperton
Copy link
Contributor

@arthurperton arthurperton commented Jul 13, 2021

This is an implementation for idea #46 and a partial fix for #3956.

It adds the mechanics for checking for reserved words and notifying the user in a meaningful way. The list of reserved words can (and probably should) be extended in the future of course.

$values = array_merge($request->values, $fields->values()->all());

return $values;
}

protected function blueprint($blueprint)
{
$reserverd = [

This comment has been minimized.

@michaelr0

michaelr0 Jul 15, 2021
Contributor

$reserverd I assume is a typo.

@@ -76,6 +93,7 @@ protected function blueprint($blueprint)
'display' => __('Handle'),
'instructions' => __('statamic::messages.fields_handle_instructions'),
'type' => 'text',
'validate' => 'required|not_in:'.join(',', $reserverd),

This comment has been minimized.

@michaelr0

michaelr0 Jul 15, 2021
Contributor

$reserverd I assume is a typo.

@jasonvarga jasonvarga merged commit 87b0b04 into statamic:3.1 Jul 15, 2021
25 checks passed
25 checks passed
@github-actions
P7.4 - L8.* - prefer-lowest - ubuntu-latest
Details
@github-actions
P7.4 - L8.* - prefer-stable - ubuntu-latest
Details
@github-actions
P7.4 - L7.* - prefer-lowest - ubuntu-latest
Details
@github-actions
P7.4 - L7.* - prefer-stable - ubuntu-latest
Details
@github-actions
P7.4 - L6.* - prefer-lowest - ubuntu-latest
Details
@github-actions
P7.4 - L6.* - prefer-stable - ubuntu-latest
Details
@github-actions
P7.3 - L8.* - prefer-lowest - ubuntu-latest
Details
@github-actions
P7.3 - L8.* - prefer-stable - ubuntu-latest
Details
@github-actions
P7.3 - L7.* - prefer-lowest - ubuntu-latest
Details
@github-actions
P7.3 - L7.* - prefer-stable - ubuntu-latest
Details
@github-actions
P7.3 - L6.* - prefer-lowest - ubuntu-latest
Details
@github-actions
P7.3 - L6.* - prefer-stable - ubuntu-latest
Details
@github-actions
P7.2 - L7.* - prefer-lowest - ubuntu-latest
Details
@github-actions
P7.2 - L7.* - prefer-stable - ubuntu-latest
Details
@github-actions
P7.2 - L6.* - prefer-lowest - ubuntu-latest
Details
@github-actions
P7.2 - L6.* - prefer-stable - ubuntu-latest
Details
@github-actions
P8 - L8.* - prefer-lowest - ubuntu-latest
Details
@github-actions
P8 - L8.* - prefer-stable - ubuntu-latest
Details
@github-actions
P8 - L7.* - prefer-lowest - ubuntu-latest
Details
@github-actions
P8 - L7.* - prefer-stable - ubuntu-latest
Details
@github-actions
P8 - L6.* - prefer-lowest - ubuntu-latest
Details
@github-actions
P8 - L6.* - prefer-stable - ubuntu-latest
Details
@github-actions
JavaScript tests
Details
@github-actions
Slack Notification
Details
continuous-integration/styleci/pr The analysis has passed
Details
@jackmcdade
Copy link
Member

@jackmcdade jackmcdade commented Jul 15, 2021

Yes!

@arthurperton arthurperton deleted the arthurperton:pr/issue-3956-blueprint-builder-reserved-field-names branch Jul 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
4 participants