SemanticMediaWiki / SemanticBreadcrumbLinks

Provides in-page navigation by building breadcrumb links from an attributive property filter.
https://www.semantic-mediawiki.org/wiki/Extension:Semantic_Breadcrumb_Links
Other
16 stars 5 forks source link

Notice: Use of undefined constant `SBL_PROP_PARENTPAGE` #56

Closed kghbln closed 4 years ago

kghbln commented 6 years ago

Setup and configuration

Issue

Notice: Use of undefined constant SBL_PROP_PARENTPAGE - assumed 'SBL_PROP_PARENTPAGE' in /.../w/LocalSettings.php on line 690

This notice is emitted for all four lines for NS_MAIN holding SBL_PROP_PARENTPAGE.

Steps to reproduce

## Semantic Breadcrumb Links
wfLoadExtension( 'SemanticBreadcrumbLinks' );
$egSBLPageTitleToHideSubpageParent = false;
$egSBLPropertySearchPatternByNamespace = [
    NS_CATEGORY => [
        '_SUBC',
        '_SUBC',
        '_SUBC'
        ],
    SMW_NS_PROPERTY => [
        '_SUBP',
        '_SUBP',
        '_SUBP'
        ],
    NS_MAIN => [
        SBL_PROP_PARENTPAGE,
        SBL_PROP_PARENTPAGE,
        SBL_PROP_PARENTPAGE,
        SBL_PROP_PARENTPAGE
        ],
    NS_HELP => [
        SBL_PROP_PARENTPAGE,
        SBL_PROP_PARENTPAGE,
        SBL_PROP_PARENTPAGE
        ]
    ];

An additional question: Do I have to redefine the whole array of arrays or is there a way to add a search strategy e.g. for NS_MAIN without touching the other arrays?

JeroenDeDauw commented 5 years ago

The constant is defined in SemanticBreadcrumbLinks::initExtension and used in SemanticBreadcrumbLinks::onExtensionFunction.

This error means the constant is used before it is defined. Either onExtensionFunction should not be called before initExtension... or the constant definition should be moved.

kghbln commented 4 years ago

I again spend over half an hour on this issue. I'd rather spend this time elsewhere on this project than looping back every half year. Is there a way to fix this? I am now on

kghbln commented 4 years ago

@mwjames It will be super cool to get a fix for this.