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

Play1.4.3 and newer not allow to override default FastTag.class (empty namespace) using @FastTags.Namespace("") #1262

Closed
anhtuan84 opened this issue Aug 30, 2018 · 2 comments

Comments

Projects
None yet
2 participants
@anhtuan84
Copy link

commented Aug 30, 2018

Play1.4.3 and newer not allow to override default FastTag.class (FastTag with empty namespace ) @FastTags.Namespace("")

I can not override defaut fastTag affter the fix : https://play.lighthouseapp.com/projects/57987/tickets/2040

In my application I override default #{filed} tags to handle some new html attributes with the code like this:

@FastTags.Namespace
public class CustomTag extends FastTags {
    public static void _field(Map<?, ?> args, Closure body, PrintWriter out, ExecutableTemplate template, int fromLine) {
...
  }
}

From play-1.4.3 that does't works. Workaround solution is adding namespace to my tag @FastTags.Namespace("custom") but I have to change many template that use #{field} to #{custom.filed}. I'm not sure that is a incident after fix issue: https://play.lighthouseapp.com/projects/57987/tickets/2040 or we don't want to allow override default FastTag

Play Version (1.4.3 )

1.4.2...1.4.3
GroovyTemplateCompiler.java:381
Suggestion:
Change from

List<Class> fastClasses = new ArrayList<>();
fastClasses.add(FastTags.class);
 fastClasses.addAll(Play.classloader.getAssignableClasses(FastTags.class));

to

List<Class> fastClasses = new ArrayList<>();
fastClasses.addAll(Play.classloader.getAssignableClasses(FastTags.class));
fastClasses.add(FastTags.class);
@anhtuan84

This comment has been minimized.

Copy link
Author

commented Sep 5, 2018

@xael-fry

This comment has been minimized.

Copy link
Member

commented Dec 13, 2018

Merged in master

@xael-fry xael-fry closed this Dec 13, 2018

@xael-fry xael-fry removed their assignment Dec 13, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.