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 missing inheritance of disabled tags #1646

Merged
merged 1 commit into from
Oct 27, 2022
Merged

Conversation

dylanahsmith
Copy link
Contributor

Problem

I noticed that when we subclass the Liquid::Render tag, it doesn't inherit the disabled tags or set the @disabled_tags instance variable on the class. This results in an internal error when the tag subclassing the Liquid::Render tag is used without the subclass also calling disable_tags "include". Also, if the subclass tried to disable another tag, it could easily re-enable the tag disabled in the subclass.

Solution

Use the same approach as rails' class_attribute of defining a method when disable_tags is called to override the parent's disabled_tags, without the method needing to be called to inherit the parent class' method.

@dylanahsmith dylanahsmith merged commit 3e8994c into master Oct 27, 2022
@dylanahsmith dylanahsmith deleted the inherit-disabled-tags branch October 27, 2022 15:41
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