Jump to content

Topic on Extension talk:MsCatSelect/Flow

SMW semantic search #ask conflict

4
Summary by Sophivorus

Partially fixed in version 8.1

Michele.Fella (talkcontribs)

NOTE: This extension at the time of writing will cause used within SMW semantic search to be removed from your query as it will be considered a declaration of the page category rather than a condition. I am sure this will be fixed.

Johnywhy (talkcontribs)

fixed?

Emmanuel Touvier (talkcontribs)

Still not fixed, but you can patch the extension to make it work with #ask:

In the file MsCatSelect.php modify the pattern declaration (line 74)

replace

$pattern = "\[\[({$categoryNamespace}):([^\|\]]*)(\|[^\|\]]*)?\]\]";

with

$pattern = "(?<!#ask:)\[\[({$categoryNamespace}):([^\|\]]*)(\|[^\|\]]*)?\]\]";


This way the extension skips all category patterns directly preceded with #ask:

Sophivorus (talkcontribs)

Hi! I just merged your patch in version 8.1 (diff). However, note that it only works when the category link is right after the #ask, so it's more like a hack than a fix. Doing it robustly would require advanced wikitext parsing. Cheers!