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

Ask with format=template breaks HTML output #1255

Closed
jongfeli opened this issue Nov 7, 2015 · 11 comments
Closed

Ask with format=template breaks HTML output #1255

jongfeli opened this issue Nov 7, 2015 · 11 comments

Comments

@jongfeli
Copy link
Contributor

jongfeli commented Nov 7, 2015

The move from SMW 2.2.3 to SMW 2.3 seems to break HTML in a {{#ask:... query with format=template. We have some buttons on which users can press which automatically update properties or values on a page but they are not working anymore. Example of the issue on: http://sandbox.semantic-mediawiki.org/wiki/User:Jongfeli

http://sandbox.semantic-mediawiki.org/wiki/Issue/1255

I tested this on MW 1.24.1 and SMW 2.1, 2.2, 2.2.3 & 2.3.0 but it is only happening in SMW 2.3.0

Below how it looks in SMW 2.2.3 (I noticed it shows 2.2.2 (D540302) on the MW version page).

screenshot from 2015-11-07 09 25 34

@mwjames
Copy link
Contributor

mwjames commented Nov 7, 2015

@mwjames
Copy link
Contributor

mwjames commented Nov 7, 2015

@jongfeli I'd be grateful if you can come up with a test case that doesn't involve SF but would return something similar for when $smwgEnabledResultFormatsWithRecursiveAnnotationSupport doesn't include template so we can include this as test case for future reference.

@kghbln FYI

@kghbln
Copy link
Member

kghbln commented Nov 7, 2015

In general I think that for such things a configuration parameter is the better choice. However I see that it would make sense to have control of this on a query level instead of the wiki level. @JeroenDeDauw What's your opinion on this?

@mwjames
Copy link
Contributor

mwjames commented Nov 7, 2015

#1257 makes it an query specific behaviour instead of a format specific one.

[0] https://semantic-mediawiki.org/wiki/Examples/Parser/Ask_with_template_to_annotate_invert_property (need to be changed to add the parameter)

@jongfeli
Copy link
Contributor Author

jongfeli commented Nov 8, 2015

@mwjames I had a go at coming up with an example that does not need SF or any other extension that generates this problem, which has the same result but with no luck. It is not possible to insert any html on a wiki page that is not allowed [0], you "need" extensions for that.

If I understand this correctly then a wikipage does not get parsed completely, so all extensions can do there trick, when recursive-parse=false? As a result the generated HTML gets blocked or/and is incomplete? This is not limited to SF but applies to all extensions that generate HTML.

For this test to work you need a test that runs against MW + SMW, no other extensions enabled?

[0] https://www.mediawiki.org/wiki/HTML_restriction

@jongfeli
Copy link
Contributor Author

jongfeli commented Nov 9, 2015

OK, I used recur-anno and the fix works fine. I noticed that the default value for recursive-parse actually makes it work again and not the other way around like I previously mentioned.

I am all for control on query level here but I am having a hard time even understanding what recursive-parse actually does when it is set to true, when do you need this? I see that it has something to do with being able to use Visual Editor but to me the name recursive-parse seems way to "softwarish" for most people to understand.

@mwjames
Copy link
Contributor

mwjames commented Nov 9, 2015

I had a go at coming up with an example that does not need SF or any other extension that generates this problem, which has the same result but with no luck.

Thanks for trying.

hard time even understanding what recursive-parse actually does when it is set to true, when do you need this?

When you have templates to create invert annotation or you want to import annotations depending on the #ask outcome (== variable with the query).. Mainly for annotations to be conditional when #ask queries are involved.

the name recursive-parse seems way to "softwarish" for most people to understand.

I'm wondering whether I should change the name to import-annotation (recursive because the process that runs through #ask result is done recursively only limited by $maxRecursionDepth)?

mwjames added a commit that referenced this issue Nov 12, 2015
Support recursive annotation per query, refs #1255, #1068
@mwjames
Copy link
Contributor

mwjames commented Nov 12, 2015

...
 |format=list
 |template=AskTemplateToAddPropertyAnnotation
 |import-annotation=true
}}

[0] http://sandbox.semantic-mediawiki.org/wiki/Issue/1255

@mwjames mwjames closed this as completed Nov 12, 2015
@jongfeli
Copy link
Contributor Author

Thanks @mwjames. 👍

To be clear on the test, if we would be able to generate a test for this, would it run against MW + SMW only? No other extensions can be used?

@mwjames
Copy link
Contributor

mwjames commented Nov 12, 2015

To be clear on the test, if we would be able to generate a test for this, would it run against MW + SMW only? No other extensions can be used?

The simple answer is yes because

In general, tests should be agnostic (== depend on as less as possible) to govern its execution in a wide range of environments without making it depend on extensions that would require interdependency monitoring.

What if you require an additional extension for those tests? You would have to track possible changes that can influence a test result. #1208 (comment) is a prime example where changes in MW (as we depend on it) causes effort (research the issue, fixing it, testing it === time that could be spent differently) to make the existing test outcome stable again to what it was designed before the changes appeared.

Simplify a test environment by trying to exercise the ceteris paribus clause where possible.

@kghbln
Copy link
Member

kghbln commented Jun 28, 2018

import-annonation now documented.

@jongfeli The example somehow looks broken. Could you have a look ...?

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

No branches or pull requests

3 participants