Page MenuHomePhabricator

Autocompletion does not work with MW ResourceLoader
Closed, ResolvedPublic

Description

jQuery is not defined:
jQuery.event.add(window, "load", attachAutocompleteToAllDocumentFields);

Firebug reports this error and the auto-completion doesn't work.

I'm getting this with SF trunk, on both MW trunk and MW 1.15.5.

The form where I'm getting this is a copy of http://mapping.referata.com/wiki/Special:FormEdit/Location/Narnia


Version: unspecified
Severity: normal

Details

Reference
bz25436

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 11:13 PM
bzimport set Reference to bz25436.

p.oranje wrote:

Autocomplete not working either here (http://www.heritage-activities.nl/mch-wiki/index.php?title=Albert_van_den_Belt&action=formedit, form=http://www.heritage-activities.nl/mch-wiki/index.php?title=Form:Expert-form).

Firebug console reports:

jQuery is not defined
 jQuery.noConflict(); [several times)

and also:

jQuery is not defined
 jQuery.event.add(window, "load", attachAutocompleteToAllDocumentFields);

and several others.

version info (http://www.heritage-activities.nl/mch-wiki/index.php?title=Special:Version):

MediaWiki  	1.17alpha (r74614)
PHP 	5.2.6 (cgi)
MySQL 	5.0.51a-24-log
Semantic Forms (Version 2.0.1)  	(r74614)
Semantic MediaWiki (Version 1.5.3 alpha)  	(r74614)

(In reply to comment #1)

It turns out that it is working just fine, except for versions of MediaWiki using the new resource loader (which currently is only 1.17 alpha). In order to fix this, a bunch of non-minor changes to SF will be needed, which are planned, but can take a while. So if you want to use SF (and many other extensions that have similar issues with 1.17), I suggest you use MediaWiki 1.16.

p.oranje wrote:

Seems a bit of a catch 22: with 1.16 edit-with-form did not work, but with 1.17 it does work well.
Since the edit with form functionality is more needed now, I'll stich around and wait for the autocompletion functionality to be restored.

Any hint on how long it may take to fix this bug?

Changing name to be more accurate.

Paul - I don't know what the issue you're having is, but it seems unrelated - I would create a different bug report for it, if you want to use Bugzilla.

As far as I know, Semantic Forms now works fully with ResourceLoader, in the code on SVN, and in what will be version 2.0.2. I'm marking this as "fixed" - if you find any problems with SF and MediaWiki 1.17, please let me know about it, either by contacting me separately, or by re-opening this bug, or by creating a more specific bug report.

p.oranje wrote:

Sorry, autocompletion still does not work as well as with phase3 1.16 branch and the previous version of SF (r74684).

Switched phase3 (from branch REL1_16) to trunk and updated SF to r75211.

A field defined as:

"! Organisations (one per line):

{{{fieldorganisationsinput type=textareaautogrowautocomplete on category=Organisationlistdelimiter=\nremote autocompletion}}}"

yields wrong output in the field after autocompletion by selection of an offered value; then shown output in the textarea is:

"Amoksi Architectuur\n "
(so not a newline is output but its character literal is shown).

Also with SF r75211 and phase3 of branch REL 1.16 produces the same erroneous output.

SF r74684 with phase3 branch REL1_16 yielded correct behaviour, in this case:

"Amoksi Architectuur
"

BTW: When using a newline as delimiter the extra space character can be omitted since a newline is allready white space by itself.

p.oranje wrote:

The revisions mentioned in the previous comment where of the extensions directory. More SF specific it should likely be r75174 for the previous revision where autocompletion worked with 1.16 but not with 1.17 and r75206 for the revision where autocompletion seems to work but produces erroneous output.

Goodluck.

Indeed, autocompletion wasn't working with the "\n" delimiter in the new code. This is fixed now.

Removing dependency on the general MW ResourceLoader tracker bug - whether or not SF works is (mostly) unrelated to whether ResourceLoader works.

p.oranje wrote:

Still producing the same wrong output on autocompletion with r75215.
Looks like the code on line 60 and following in SemanticForms.js is never reached, anyway not when an item is selected from a list.

Hi - I didn't realize before that you were using remote autocompletion. Indeed, it wasn't working with remote autocompletion; I think it's fixed now, though, in SVN. As always, feel free to re-open the bug report.

p.oranje wrote:

Yaron, it works. Well done! (and quickly). S.y. Paul