Help:Configuration parameter "$smwgLinksInValues"

From semantic-mediawiki.org
Jump to: navigation, search
edit with form


Title $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
First version supported
Last version supported still available
Configuration Installation
Keyword property · property value

$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 setting 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.

Default setting

$smwgLinksInValues = false;

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

Available options

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

To modify this configuration setting, 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

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.4 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



References

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