New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ParameterInput causes "HTML attribute value can not contain a list of values" #1473

Closed
mwjames opened this Issue Mar 25, 2016 · 3 comments

Comments

Projects
None yet
2 participants
@mwjames
Contributor

mwjames commented Mar 25, 2016

Setup and configuration

  • SMW version: 2.4-alpha
  • MW version:
  • DB (MySQL etc.):

Issue

Produces a stack trace and outputs:

[5ec25b63] /w/index.php?title=Sp%C3%A9cial%3AAsk&q=%5B%5BHas+coordinates%3A%3A%2B%5D%5D&po=Has+coordinates&eq=yes&p%5Bformat%5D=openlayers&sort_num=&order_num=ASC&p%5Bsource%5D=&p%5Blimit%5D=&p%5Boffset%5D=&p%5Blink%5D=all&p%5Bsort%5D=&p%5Bheaders%5D=show&p%5Bmainlabel%5D=&p%5Bintro%5D=&p%5Boutro%5D=&p%5Bsearchlabel%5D=%26hellip%3B+autres+r%C3%A9sultats&p%5Bdefault%5D=&p%5Bclass%5D=sortable+wikitable+smwtable&p%5Bsep%5D=&eq=yes MWException from line 572 of /var/www/htdocs/mw/02100/w/includes/Html.php: HTML attribute value can not contain a list of values

Backtrace:

#0 /var/www/htdocs/mw/02100/w/includes/Html.php(307): Html::expandAttributes(array)
#1 /var/www/htdocs/mw/02100/w/includes/Html.php(219): Html::openElement(string, array)
#2 /var/www/htdocs/mw/02100/w/includes/Html.php(247): Html::rawElement(string, array, string)
#3 /var/www/htdocs/mw/02100/w/includes/Html.php(724): Html::element(string, array)
#4 /var/www/htdocs/mw/02100/w/extensions/SemanticMediaWiki/includes/ParameterInput.php(181): Html::input(string, array, string, array)
#5 /var/www/htdocs/mw/02100/w/extensions/SemanticMediaWiki/includes/ParameterInput.php(118): SMW\ParameterInput->getStrInput()
#6 /var/www/htdocs/mw/02100/w/extensions/SemanticMediaWiki/includes/specials/SMW_QuerySpecialPage.php(154): SMW\ParameterInput->getHtml()
#7 /var/www/htdocs/mw/02100/w/extensions/SemanticMediaWiki/includes/specials/SMW_QuerySpecialPage.php(66): SMWQuerySpecialPage->showFormatOption(ParamProcessor\Definition\StringParam, boolean)
#8 /var/www/htdocs/mw/02100/w/extensions/SemanticMediaWiki/includes/specials/SMW_SpecialAsk.php(427): SMWQuerySpecialPage->showFormatOptions(string, array)
#9 /var/www/htdocs/mw/02100/w/extensions/SemanticMediaWiki/includes/specials/SMW_SpecialAsk.php(361): SMWAskPage->getInputForm(string, string, string, string)
#10 /var/www/htdocs/mw/02100/w/extensions/SemanticMediaWiki/includes/specials/SMW_SpecialAsk.php(63): SMWAskPage->makeHTMLResult()
#11 /var/www/htdocs/mw/02100/w/includes/specialpage/SpecialPage.php(384): SMWAskPage->execute(NULL)
#12 /var/www/htdocs/mw/02100/w/includes/specialpage/SpecialPageFactory.php(582): SpecialPage->run(NULL)
#13 /var/www/htdocs/mw/02100/w/includes/MediaWiki.php(263): SpecialPageFactory::executePath(Title, RequestContext)
#14 /var/www/htdocs/mw/02100/w/includes/MediaWiki.php(634): MediaWiki->performRequest()
#15 /var/www/htdocs/mw/02100/w/includes/MediaWiki.php(482): MediaWiki->main()
#16 /var/www/htdocs/mw/02100/w/index.php(41): MediaWiki->run()
#17 {main}

Steps to reproduce the observation (recommendation is to use the sandbox):

@mwjames mwjames added the bug label Mar 25, 2016

@mwjames mwjames added this to the SMW 2.4 milestone Mar 25, 2016

@mwjames

This comment has been minimized.

Contributor

mwjames commented Mar 25, 2016

Caused by ParameterInput::getValueToUse which returns an empty array and causes the HTML class to fall over:

Solution

@@ -138,10 +138,14 @@ class ParameterInput {

        if ( $this->param->isList() && is_array( $value ) ) {
            $value = implode( $this->param->getDelimiter(), $value );
        }

+       if ( $value === array() ) {
+           $value = '';
+       }
@djflux

This comment has been minimized.

djflux commented Aug 27, 2018

I am having this issue (screenshot similar to fuerthwiki/wiki#97) and want to see if I should open a separate issue.

Here are my versions.

Product Version
MediaWiki 1.31.0 (5cfc9ac)2018-06-13T10:34:24
PHP 7.0.31 (apache2handler)
MariaDB 5.5.60-MariaDB
ICU 50.1.2
Elasticsearch 5.6.11
Semantic MediaWiki 2.5.6
Page Forms 4.3.1 (0ba6735)2018-06-18T15:35:28
@mwjames

This comment has been minimized.

Contributor

mwjames commented Aug 27, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment