Fix subscription module accessing an invalid URL for REST-API#85
Open
SebDieBln wants to merge 3 commits intotrac-hacks:masterfrom
Open
Fix subscription module accessing an invalid URL for REST-API#85SebDieBln wants to merge 3 commits intotrac-hacks:masterfrom
SebDieBln wants to merge 3 commits intotrac-hacks:masterfrom
Conversation
bbd261a to
cb3e1bb
Compare
…ible with trac.util.html.tag genshi.builder.tag converts attribute names like 'data_base_url' to 'data-base-url' which makes them accessible by jQuery's .data() API. trac.util.html.tag does not do that. fixes regression in fa7cdff
cb3e1bb to
310e794
Compare
This will be necessary to be able to dynamically create the subscription button.
The button is now created using javascript.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The subscription REST-API lives under
/subscription. However the code tried accessing/undefined/subscriptionundefined.The reason is that the base URL is supposed to be encoded in the HTML attribute
data-base-urland the path indata-path. These attribute names can not be used in Python as argument because they contain dashes. So in Python the dashes are replaced by underscores.genshi.builder.tagconverts the underscores back to dashes and therefore generates the required attribute names. Its supposed replacementtrac.util.html.html(which was enabled in fa7cdff) does not perform such a conversion thereby generating the wrong HTML attributes leading to the wrong URL in the request.For the upcoming migration away from Genshi we could consider using the already present
CodeCommentsdictionary. It already contains a "path" element, although with a somewhat different content.