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

SMW on #2209

Closed
alex-mashin opened this Issue Jan 26, 2017 · 4 comments

Comments

Projects
None yet
4 participants
@alex-mashin

alex-mashin commented Jan 26, 2017

Setup and configuration

  • SMW version: 2.4.5
  • MW version: 1.28.0
  • PHP version: HHVM 3.17.1
  • DB (MySQL etc.): MariaDB 10.1.21

Issue

The same query:

{{#ask:
[[ISBN::5897470170]]
| ?#-
| ?Название#-
| ?Написан автором
| ?Кем издано
| ?Год публикации
| ?ISBN#-
| mainlabel=-
| [headers=hide]
| link=all
| default=Статья о·книге в·«Традиции» не·найдена
| format=list
| template=Книга/Нумерованные параметры
}}

produces the expected result:

Андрей Петрович Паршев Почему Россия не Америка. — Крымский мост-9Д, 2000. — ISBN 5897470170>

when invoked on a regular page (e.g. https://traditio.wiki/Traditio:Smwon) but is preceded with SMW:off an follewed with SMW:on when invoked on Special:Book sources (via Project:Book sources) (e.g. https://traditio.wiki/%D0%A1%D0%BB%D1%83%D0%B6%D0%B5%D0%B1%D0%BD%D0%B0%D1%8F:%D0%98%D1%81%D1%82%D0%BE%D1%87%D0%BD%D0%B8%D0%BA%D0%B8_%D0%BA%D0%BD%D0%B8%D0%B3/5897470170#.D0.9F.D0.BE.D0.B8.D1.81.D0.BA_.D1.81.D1.82.D1.80.D0.B0.D0.BD.D0.B8.D1.86.D1.8B_.D0.BE.C2.A0.D0.BA.D0.BD.D0.B8.D0.B3.D0.B5_.D0.B2.C2.A0.C2.AB.D0.A2.D1.80.D0.B0.D0.B4.D0.B8.D1.86.D0.B8.D0.B8.C2.BB, section 1):

SMW::offАндрей Петрович Паршев Почему Россия не Америка. — Крымский мост-9Д, 2000. — ISBN 5897470170>SMW::on.
@jaideraf

This comment has been minimized.

Member

jaideraf commented Jan 26, 2017

You can try to set the $smwgEnabledSpecialPage configuration parameter like as follows in your LocalSettings.php:

$smwgEnabledSpecialPage = array( 'Ask', 'BookSources' );

@kghbln kghbln added the question label Jan 26, 2017

@kghbln

This comment has been minimized.

Member

kghbln commented Jan 26, 2017

Yeah, that should be it. Great @jaideraf I would not have thought about this setting in the first place. Thanks for this re-vaccination.

@alex-mashin

This comment has been minimized.

alex-mashin commented Jan 27, 2017

You can try to set the $smwgEnabledSpecialPage

Tried this; did not help.

@mwjames

This comment has been minimized.

Contributor

mwjames commented Jan 28, 2017

to set the $smwgEnabledSpecialPage configuration parameter like as follows in your LocalSettings.php:
$smwgEnabledSpecialPage = array( 'Ask', 'BookSources' );

👍 Very good observation (it should be Booksources because of [0]).

Tried this; did not help.

See comments below.

with SMW:on when invoked on Special:Book sources (via Project:Book sources)

I'm guessing those "(via Project:Book sources)" are maintained as messages where SMW in general is to skip parsing of content that is injected via a Message object [1] (avoids a performance penalty otherwise each message would require us the inspect a message and its text body in case the InternalParseBeforeLinks hook is called).

Nevertheless, I changed the process in #2211 so that in case a special page is enabled in smwgEnabledSpecialPage to be allowed to parse [[ ... :: ...]] annotations including those with a [[SMW::on]] marker.

[0] https://github.com/wikimedia/mediawiki/blob/6ee3f9aeaa480ce5e85fbfe4f624ff1bbeca5186/includes/specials/SpecialBooksources.php#L33

PS: Some discussion about InternalParseBeforeLinks and Message can be found at https://phabricator.wikimedia.org/T134562#2816538

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment