SemanticMediaWiki / SemanticMediaWiki

🔗 Semantic MediaWiki turns MediaWiki into a knowledge management platform with query and export capabilities
https://www.semantic-mediawiki.org
Other
516 stars 228 forks source link

smwgNamespacesWithSemanticLinks not working #1519

Closed hexmode closed 8 years ago

hexmode commented 8 years ago

Setup and configuration

The $smwgNamespacesWithSemanticLinks setting doesn't seem to work. Setting it has no effect. Looking at #184 shows that twn saw a similar problem, but setting the variable before or after SMW is loaded seems to have no affect. I even tried setting it in index.php before anything else, but, again, no affect was seen.

I suspected caching of some sort but restarting everything didn't seem to do anything.

kghbln commented 8 years ago

@hexmode Is this a fresh install? If not you need to run "rebuildData.php" to get the data for already existing pages in.

This setting must be after the enableSemantics(...); call and after all the namespaces are defined for the wiki. Could you post your configuration setting for this, but I believe it will be something like $smwgNamespacesWithSemanticLinks[NS_TALK] = true; so I do not expect much from this. Just did this two days ago on one of my wikis without worries. Hmm....

hexmode commented 8 years ago

Note that I ended up getting this error in ApprovedRevs that I'm currently working around.

kghbln commented 8 years ago

So if I interpret your response correctly this is working for you again though giving other worries.

hexmode commented 8 years ago

yes, I think we can assume that rebuildData is going to fix it. I've found a fix for the ApprovedRevs issue and it is chugging along. I should know by tomorrow.

kghbln commented 8 years ago

Ah great. I hope that ApprovedRevs is going to be cool soon, too!

hexmode commented 8 years ago

Note that this is solved, but rebuildData.php didn't solve the problem. The problem ended up with the way I was setting $smwgNamespacesWithSemanticLinks. I assumed it worked like a some other namespace variables ($wgCollectionArticleNamespaces, $wgVisualEditorNamespaces, $egApprovedRevsNamespaces) and not like $wgNamespacesToBeSearchedDefault or $wgNamespacesWithSubpages.

mwjames commented 8 years ago

The problem ended up with the way I was setting $smwgNamespacesWithSemanticLinks. I assumed it worked like a some other namespace variables

I assumed the documentation [0] to be rather clear on the expected setting. If you think it needs a clarifying comment maybe adding a word or two can help others to avoid making the same assumption.

[0] https://www.semantic-mediawiki.org/wiki/Help:$smwgNamespacesWithSemanticLinks

hexmode commented 8 years ago

mwjames writes:

I assumed the documentation [0] to be rather clear on the expected setting.

You're right. It is clear.

I didn't look at the documentation for the variable because I didn't think about the way namespace-related variables have this inconsistancy in how they are set.

FWIW, I wish developers would standardize the way they use variables like this and I think SMW is using the "right" way. VE, for example, recently changed from the wrong way with $wgVisualEditorNamespaces to the right way with $wgVisualEditorAvailableNamespaces.