$smwgLinksInValues

From semantic-mediawiki.org


Configuration parameter details:
Name $smwgLinksInValues
Description Sets whether internal links in values for properties of datatype "Text" may be stored within property values
Default setting
false
Software Semantic MediaWiki
Since version
Until version still available
Configuration Installation
Keyword property · property value · displaying values · annotation · interface


$smwgLinksInValues is a configuration parameter that sets whether internal links within property values for properties of datatype "Text"Holds text of arbitrary length such as e.g. [[Property::Some [[internal link]] in property value.]] may be resolved. The configuration parameter was introduced in Semantic MediaWiki 1.3.0Released on 7 September 2008 and compatible with MW 1.12.x - 1.15.x.. Starting with Semantic MediaWiki 2.5.0Released on 14 March 2017 and compatible with MW 1.23.0 - 1.29.x.1 the settings to this configuration parameter and the underlying behaviour of the wiki was changed to eliminate the deficiency caused by the earlier PCRE approach as described below as legacy behaviour.

This configuration parameter's option SMW_LINV_OBFU was deprecated with Semantic MediaWiki 3.0.0Released on 11 October 2018 and compatible with MW 1.27.0 - 1.31.x. in favour of option SMW_PARSER_LINV to configuration parameter $smwgParserFeaturesSets the behaviour of features related to text and annotation parsing streamlining the overall configuration of Semantic MediaWiki. The legacy option SMW_LINV_PCRE to this configuration parameter is no longer supported.2 Thus you are advised to migrate your settings in "LocalSettings.php" to the new configuration parameter since this one will be removed with the release of Semantic MediaWiki 3.1.0Released on 23 September 2019 and compatible with MW 1.31.0 - 1.33.x. in 2019.

Default setting[edit]

$smwgLinksInValues = false;

This means that links in values for datatype "Text"Holds text of arbitrary length are not allowed.

Available options[edit]

This option moreover supports resolving of in-text annotations within a text element such as e.g. [[Has text::[[Lorem ipsum]] dolor sit amet, [[Has page::consectetur adipiscing elit]]]].
  • SMW_LINV_PCRE - Allows to avoid breakages for existing wikis by retaining the behaviour formerly set with "true" retained as a legacy setting.
    NoteNote: Setting "true" to this configuration parameter is still supported as a legacy setting and identical to setting this option.

Changing the default setting[edit]

To modify the setting to this configuration parameter, add one of the following lines to your "LocalSettings.php" file after the enableSemantics() call:

Enable extended use cases, better performance and less issues
$smwgLinksInValues = SMW_LINV_OBFU;

This means that links in values for datatype "Text"Holds text of arbitrary length are allowed. This is the recommended setting for this configuration parameter.

Retain the deprecated PCRE approach as described below
$smwgLinksInValues = SMW_LINV_PCRE;

or

$smwgLinksInValues = true;

This means that links in values for datatype "Text"Holds text of arbitrary length are allowed however using the deprecated PCRC approach as described below as legacy behaviour. This is the recommended setting for this configuration parameter.

Legacy behaviour[edit]

The results of a query displayed on special page "Ask"Provides an interface that assists users with creating and executing semantic queries are not parsed further even if this setting is enabled. This means that results for properties of datatype "Text"Holds text of arbitrary length containing links will be displayed as-is, i.e. links like SMW Project within the data value will be displayed as [[Help:SMW Project|SMW Project]].

If enabled, this may lead to PHP crashes (!) when very long texts are used as values. This is due to limitations in earlier versions of the library PCRE that PHP uses for pattern matching. The provoked PHP crashes will prevent requests from being completed - usually clients will receive server errors like e.g. "invalid response" or be offered to download "index.php". In later versions this may cause the maintenance script "rebuildData.php" to fail.5 It might however be okay to enable this if such problems are not observed in your wiki.
Probably starting with Semantic MediaWiki 1.9.0Released on 3 January 2014 and compatible with MW 1.19.0 - 1.22.x. it is possible to use the #set parser function to annotate links in values without the need to change this configuration parameter. See also the demo page on how to do this. - Use the SMW_LINV_OBFU option instead starting with Semantic MediaWiki 2.5.0Released on 14 March 2017 and compatible with MW 1.23.0 - 1.29.x..

See also[edit]



References

  1. a b  |  Semantic MediaWiki: GitHub pull request gh:smw:2153
  2. ^  |  Semantic MediaWiki: GitHub pull request gh:smw:2841
  3. ^  |  Semantic MediaWiki: GitHub issue comment gh:smw:2153:271164759
  4. ^  |  Semantic MediaWiki: GitHub pull request gh:smw:2267
  5. ^  |  Semantic MediaWiki: GitHub issue gh:smw:1963