Skip to content
This repository has been archived by the owner on Dec 14, 2018. It is now read-only.

UrlResolutionTagHelper doesn't work with TagHelpers that run before and supress output. #4317

Closed
NTaylorMullen opened this issue Mar 19, 2016 · 3 comments
Assignees
Milestone

Comments

@NTaylorMullen
Copy link
Contributor

If a user has a TagHelper and sets its order to int.MinValue, it'll run before the UrlResolutionTagHelper. Now, if that same TagHelper calls output.SuppressOutput() it will then force the TagHelperOutputs tag name to null. The problem this introduces is the UrlResolutionTagHelper relies on the TagName not being null when looking up corresponding attribute values for the tag so it ends up exploding here.

We should check if TagName == null and if so, bail early.

@javiercn
Copy link
Member

Would other taghelper types be affected by this same issue? the code that has the error seems applicable in many tag helpers (do we have more cases like this on our codebase)? /cc: @NTaylorMullen

@NTaylorMullen
Copy link
Contributor Author

Very possible. Would have to give them a closer look or build out a sample to verify. When we wrote them initially we tried to ensure they could react to other TagHelpers in the pipeline; however, that was lower priority. We covered a lot of cases but obviously not everything 😄

@javiercn
Copy link
Member

I looked up the implementation of all tag helpers I could find, I didn't see a similar pattern, so I think it's just this one

javiercn added a commit that referenced this issue Mar 28, 2016
javiercn added a commit that referenced this issue Mar 28, 2016
javiercn added a commit that referenced this issue Mar 30, 2016
javiercn added a commit that referenced this issue Mar 30, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants