SemanticResultFormats icon indicating copy to clipboard operation
SemanticResultFormats copied to clipboard

Eventcalendar format: Exception in load-callback in module ext.srf.eventcalendar

Open kghbln opened this issue 6 years ago • 12 comments

Setup

  • MediaWiki | 1.27.5 (f899732)23:02, 25 April 2019
  • PHP | 7.0.33-0+deb9u3 (apache2handler)
  • MariaDB | 10.1.38-MariaDB-0+deb9u1
  • Semantic MediaWiki | 3.0.2 (5623547) 10:16, 11 April 2019
  • Semantic Result Formats | 3.0.1 (e1956df) 00:43, 28 March 2019
  • Browsers and versions (if applicable): Fx 66.0.5; Ch 73.0.3683.86; probably all others too

Issue

The eventcalendar does not load due to:

Exception in load-callback in module ext.srf.eventcalendar: load.php:178:411

TypeError: list[property] is undefined TypeError: "list[property] is undefined" load.php:178:449
	getTypeId https://wiki.karlsregion.net/w/load.php?debug=false&lang=en&modules=ext.srf|ext.srf.api,util&skin=vector&version=377cb0949135:4
	normalize https://wiki.karlsregion.net/w/load.php?debug=false&lang=en&modules=ext.srf|ext.srf.api,util&skin=vector&version=377cb0949135:6
	each jQuery
	normalize https://wiki.karlsregion.net/w/load.php?debug=false&lang=en&modules=ext.srf|ext.srf.api,util&skin=vector&version=377cb0949135:6
	type https://wiki.karlsregion.net/w/load.php?debug=false&lang=en&modules=ext.srf|ext.srf.api,util&skin=vector&version=377cb0949135:7
	jQuery 20
		init
		<anonymous>
		fire
		fireWith
		tuple[0]
		handlePending
		markModuleReady
		runScript
		fire
		add
		always
		runScript
		checkCssHandles
		cssHandle
		fire
		fireWith
		fire
		fireCallbacks
		addEmbeddedCSS
		cssBufferTimer

Example

See this wiki.

kghbln avatar May 16 '19 15:05 kghbln

@s7eph4n @mwjames Is a quick and dirty fix possible? Thanks a ton!

kghbln avatar May 16 '19 15:05 kghbln

I wonder if this is perhaps an issue cause in connection with earlier versions of MediaWiki since it appears to be working on sandbox?

kghbln avatar May 22 '19 09:05 kghbln

No idea, really. The error is thrown in ext.srf.api.results.js, line 138 See the console for https://wiki.karlsregion.net/z/Kalender?debug=true It's likely that the actual problem is somewhere else, though.

s7eph4n avatar May 26 '19 19:05 s7eph4n

TypeError: list[property] is undefined TypeError: "list[property] is undefined" load.php:178:449 getTypeId https://wiki.karlsregion.net/w/load.php?debug=false&lang=en&modules=ext.srf|ext.srf.api,util&skin=vector&version=377cb0949135:4

It's likely that the actual problem is somewhere else, though.

https://github.com/SemanticMediaWiki/SemanticResultFormats/blob/4e7d8d77b53c2641def1e0c03ce2bf5f49341d3b/resources/ext.srf.api.results.js

I haven't seen this error before and the specific file was last changed on Feb 11, 2013.

mwjames avatar May 26 '19 20:05 mwjames

Thanks a lot for looking at this.

From your responses I get the impression that somehow the data model on this wiki is causing the issue. Since all involved properties have a datatype assigned I can only imagine that one of them is not set up with the correct one, e.g. page instead of date, etc. May this be a possible cause? I am unsure what to make of the "list[property] is undefined" warning.

Still wondering why it was working before.

kghbln avatar May 28 '19 09:05 kghbln

The problem seems to be that the property value it looks for is Has event start#ISO, while the list only contains Has event start. So it seems that the formatting option is not properly cut off of the property value.

Edit: "not properly"

s7eph4n avatar May 28 '19 09:05 s7eph4n

Seems like srf.api.query.prototype.printouts.toList() needs fixing

s7eph4n avatar May 28 '19 09:05 s7eph4n

The problem seems to be that the property value it looks for is Has event start#ISO, while the list only contains Has event start. So it seems that the formatting option is not properly cut off of the property value.

Affirmative, removing the output formatter #ISO makes the issue go away. Thanks a ton for this tip!

kghbln avatar May 28 '19 13:05 kghbln

hmm. removing #ISO did not help in my case.

TypeError: list[property] is undefined load.php:4:269
    getTypeId ../load.php?debug=false&lang=de&modules=ext.srf|ext.srf.api,util&skin=vector&version=07dcxza:4
    normalize ../load.php?debug=false&lang=de&modules=ext.srf|ext.srf.api,util&skin=vector&version=07dcxza:6
    each jQuery
    normalize ../load.php?debug=false&lang=de&modules=ext.srf|ext.srf.api,util&skin=vector&version=07dcxza:6
    type ../load.php?debug=false&lang=de&modules=ext.srf|ext.srf.api,util&skin=vector&version=07dcxza:7
    jQuery 12
        init
        <anonym>
        fire
        fireWith
        tuple[0]
        using
        <anonym>
        each
        each
        <anonym>
        mightThrow
        process
MediaWiki 1.31.5
PHP 7.1.26 (fpm-fcgi)
MySQL 5.5.62-cll
ICU 4.2.1
Semantic MediaWiki 3.1.0 (751b79b) 00:45, 24. Sep. 2019
Semantic Result Formats 3.1.0 (aa0649f) 18:55, 18. Aug. 2019

krabina avatar Nov 13 '19 13:11 krabina

I figured that in my case I am using a property "Datum" - which is not good since it has besome a predefined one, but still it worked. My workaround ist to give it another name, e. g. |?Datum=Kalenderdatum works. So if there are no #ISO formatters and there is a different name for "Datum", then it works. (My second date is called "Datum bis" which does not have the problem.

krabina avatar Nov 13 '19 14:11 krabina

Product Version
MediaWiki 1.35.6 (ee3376f) 00:56, 1 April 2022
PHP 7.3.31-1~deb10u1 (apache2handler)
MariaDB 10.3.34-MariaDB-0+deb10u1
Semantic MediaWiki 3.2.3 (5619c2d) 00:40, 30 March 2021
Semantic Result Formats 4.0.1 (44c0bd8) 13:52, 26 January 2022

Uncaught TypeError: Cannot read properties of undefined (reading 'typeid')
    at Object.getTypeId (<anonymous>:156:291)
    at String.<anonymous> (<anonymous>:158:770)
    at Function.each (/w/load.php?lang=en&modules=ext.jquery.fullcalendar%7Cjquery%7Cjquery.ui&skin=vector&version=1480d:427:285)
    at normalize (<anonymous>:158:603)
    at Object.type (<anonymous>:159:32)
    at srf.formats.eventcalendar.init (<anonymous>:119:8)
    at <anonymous>:125:441
    at fire (/w/load.php?lang=en&modules=ext.jquery.fullcalendar%7Cjquery%7Cjquery.ui&skin=vector&version=1480d:468:930)
    at Object.fireWith [as resolveWith] (/w/load.php?lang=en&modules=ext.jquery.fullcalendar%7Cjquery%7Cjquery.ui&skin=vector&version=1480d:470:135)
    at Object.deferred.<computed> [as resolve] (/w/load.php?lang=en&modules=ext.jquery.fullcalendar%7Cjquery%7Cjquery.ui&skin=vector&version=1480d:473:632)

The error console is throwing for me is a bit different, however removing the #ISO formatter from the printout helps to get the calendar back.

kghbln avatar Apr 02 '22 08:04 kghbln

My workaround ist to give it another name, e. g. |?Datum=Kalenderdatum works.

I can confirm, what @krabina said.

gesinn-it-gea avatar Jan 28 '23 10:01 gesinn-it-gea