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 Prevent backslash in CSS class name #10663

Merged
merged 1 commit into from
Jan 30, 2023

Conversation

lekoala
Copy link
Contributor

@lekoala lekoala commented Jan 27, 2023

since the default code is using get_called_class, you can end up with \ in the class name which is an escape character for css selectors this update convert for example

even valCMS_ACCESS_SilverStripe\VersionedAdmin\ArchiveAdmin to
even valCMS_ACCESS_SilverStripe-VersionedAdmin-ArchiveAdmin

ArchiveAdmin class should probably implement private static $required_permission_codes = 'CMS_ACCESS_ArchiveAdmin '; also

@michalkleiner michalkleiner changed the title Prevent backslash in class name FIX Prevent backslash in CSS class name Jan 27, 2023
@michalkleiner
Copy link
Contributor

I reckon we can treat this as a bugfix and target 4.12 to get it in faster.

@lekoala
Copy link
Contributor Author

lekoala commented Jan 27, 2023

@michalkleiner :) the sooner the better
just found out about the issue while trying to add this in css in a project where i'm not using campaigns/archives

@lekoala
Copy link
Contributor Author

lekoala commented Jan 27, 2023

:) i know i can use hidden_permissions

@GuySartorelli
Copy link
Member

Yup I agree. If you retarget this to 4.12 we can release as a bug fix. If I see this is still targeting 4 when I get to work in Monday I'll probably just merge as is and you'll have to wait for 4.13

@michalkleiner
Copy link
Contributor

Or create a new PR with the same code targeting 4.12. Can you rebase and retarget @lekoala?

lekoala added a commit to lekoala/silverstripe-framework that referenced this pull request Jan 30, 2023
@lekoala
Copy link
Contributor Author

lekoala commented Jan 30, 2023

@michalkleiner here is the other pr #10667

@dhensby dhensby changed the base branch from 4 to 4.12 January 30, 2023 09:25
since the default code is using get_called_class, you can end up with \ in the class name which is an escape character for css selectors
this update convert for example

even valCMS_ACCESS_SilverStripe\VersionedAdmin\ArchiveAdmin
to
even valCMS_ACCESS_SilverStripe-VersionedAdmin-ArchiveAdmin

ArchiveAdmin class should probably implement     private static $required_permission_codes = 'CMS_ACCESS_ArchiveAdmin '; also
@dhensby
Copy link
Contributor

dhensby commented Jan 30, 2023

Rebased for you

@michalkleiner michalkleiner merged commit 20e4aae into silverstripe:4.12 Jan 30, 2023
@michalkleiner
Copy link
Contributor

michalkleiner commented Jan 30, 2023

Released in 4.12.3

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.

4 participants