Default values for SMW {{#show:}} calls reliably do not work if the page we ask data from has any incoming properties. An example can be seen here: https://wiki.liquipedia.space/wiki/index.php/SMW_Default_Value
==Mentionned Page==
{{#show:SMW Mentionned Page|?has test|default=no data}}
==Not Mentionned Page==
{{#show:SMW Not Mentionned Page|?has test|default=no data}}
Both SMW Mentionned Page And SMW Not Mentionned Page page do not exist, but SMW Mentionned Page has incoming data as another page has the page title set as a property: https://wiki.liquipedia.space/wiki/index.php?title=SMW_Mentioning_Page&action=edit
See also https://wiki.liquipedia.space/wiki/index.php/Special:Browse?title=Special%3ABrowse&article=SMW+Mentionned+Page and https://wiki.liquipedia.space/wiki/index.php/Special:Browse?title=Special%3ABrowse&article=SMW+Not+Mentionned+Page
In https://github.com/SemanticMediaWiki/SemanticMediaWiki/blob/master/src/Query/ResultPrinters/ResultPrinter.php#L326 $results->getCount() will return 1 for SMW Mentionned Page, even though the page does not exist at all.
I included a minimal testcase above, relevant URLs are
I wanted to provide quick feedback!
Both SMW Mentionned Page And SMW Not Mentionned Page page do not exist, but SMW Mentionned Page has incoming data as another page has the page title set as a property
Incoming entities as those seen in Special:Browse and objects (entities) returned as result of a query are two different concepts that cannot be used as basis for a comparison.
The QueryEngine can return objects that don't exists as "MediaWiki" page but are recognized as "object" value especially when constructing or work with inverse conditions.
https://wiki.liquipedia.space/wiki/index.php/SMW_Default_Value
I haven't look at the issue at all and I won't find time within the next couple of weeks to attend this issue unless someone else can distill it and provide a fairly simple use (== test) case/scenario.
I appreciate the links and description but it would still require a considerable effort from my side to review the content, identify, and dissect the issue, so I'm asking others (@kghbln @hexmode @krabina @planetenxin @s7eph4n @jamesmontalvo3) to fill in the blanks allowing me not to be involved and answer each and every ticket.
@FO-nTTaX does the issue occur after a change in the software environment (e.g. update)? Has a similar setup been working on a different software environment (e.g. with SMW 2.x)?
@gesinn-it We updated from 2.5.8 where it worked to 3.0.0 where it does not. We did not change anything but SMW, so I can pretty much exclude external factors (also that test wiki I linked has nothing else installed).
==Mentionned Page==
{{#show:SMW Mentionned Page|?has test|default=no data}}
==Not Mentionned Page==
{{#show:SMW Not Mentionned Page|?has test|default=no data}}
It should be noted that #show uses the list (or plainlist) as default format if no other format is specific and in your specific use case relying on default as output only applies for that format, any other format (e.g. table) would produce a different output (goes for both 3.+ and 2.5+).
Whether [[SMW Mentionned Page]] (or [[SMW Not Mentionned Page]]) exists in MW or not as page is irrelevant, in SMW it represents a valid entity in terms of its object space meaning that has an ID and can be used as referential object instance.
If I'm not mistaken then this relates to the #2488 (Rework List format) change. In 2.5.8 the ListResultPrinter would allow something like:
while with 3.0 it returns '':
Adding return $this->params['default']; should restore the previous behaviour.
The fix you have suggested seems to work on my test wiki from what I see after adding it to the file.
Write an integration test that covers the use case
I will try to tackle this and send a PR together with it.
The fix you have suggested seems to work on my test wiki from what I see after adding it to the file.
Ok I have to retract that. On properties that do exist, this would actually print both the result AND the default text.

Most helpful comment
The fix you have suggested seems to work on my test wiki from what I see after adding it to the file.