Skip to content
This repository has been archived by the owner on Aug 21, 2020. It is now read-only.

Bug: Autocomplete implementation inconsistent #23

Open
jonashaefele opened this issue Jun 10, 2016 · 2 comments
Open

Bug: Autocomplete implementation inconsistent #23

jonashaefele opened this issue Jun 10, 2016 · 2 comments

Comments

@jonashaefele
Copy link

Problem

Blog Post Editor fails to load due to autocomplete error.

Cannot set property '_renderItem' of undefined

That's this line: https://github.com/punkave/apostrophe-schemas/blob/master/public/js/editor.js#L847

Fix

On line https://github.com/punkave/apostrophe-schemas/blob/master/public/js/editor.js#L846 a DOM element is selected with the jQuery UI in v1.9 syntax:

<div data-autocomplete="..."></div>

Then on line https://github.com/punkave/apostrophe-schemas/blob/master/public/js/editor.js#L847 the same autocomplete instance is accessed with the jQuery UI in v1.10 syntax:

<div data-ui-autocomplete="..."></div>

See: http://stackoverflow.com/questions/9513251/cannot-set-property-renderitem-of-undefined-jquery-ui-autocomplete-with-html

For me it was fixed changing https://github.com/punkave/apostrophe-schemas/blob/master/public/js/editor.js#L847 to:

    $autocomplete.data( "autocomplete" )._renderItem = function(ul, item) {

Happy to make a PR if it's only this one line, but I'm not sure if this fix might break something else.... would appreciate feedback from someone who's worked with apostrophe for more than a couple days.

@jonashaefele
Copy link
Author

jonashaefele commented Jun 10, 2016

Steps to reproduce locally: Create blog as a subpage, then add blogpost

Using a stripped down version of the sandbox. (same modules, minus the styles and demo markup) Can't reproduce the bug on the http://demo.apostrophenow.com/

My dependency versions:

"apostrophe-blog-2": "0.5.x",
    "apostrophe-browserify": "0.5.x",
    "apostrophe-editor-2": "0.5.x",
    "apostrophe-events": "^0.5.18",
    "apostrophe-groups": "0.5.x",
    "apostrophe-people": "0.5.x",
    "apostrophe-redirects": "0.5.x",
    "apostrophe-search": "0.5.x",
    "apostrophe-site": "0.5.x",
    "apostrophe-snippets": "^0.5.79",
    "apostrophe-ui-2": "0.5.x"

@boutell
Copy link

boutell commented Jun 14, 2016

I haven't seen this problem so far, but I'm open to a PR that resolves it
in a backwards compatible way.

On Fri, Jun 10, 2016 at 12:46 PM, Jonas [email protected] wrote:

Using a stripped down version of the sandbox. (same modules, minus the
styles and demo markup) Can't reproduce the bug on the
http://demo.apostrophenow.com/

My dependency versions:

"apostrophe-blog-2": "0.5.x",
"apostrophe-browserify": "0.5.x",
"apostrophe-editor-2": "0.5.x",
"apostrophe-events": "^0.5.18",
"apostrophe-groups": "0.5.x",
"apostrophe-people": "0.5.x",
"apostrophe-redirects": "0.5.x",
"apostrophe-search": "0.5.x",
"apostrophe-site": "0.5.x",
"apostrophe-snippets": "^0.5.79",
"apostrophe-ui-2": "0.5.x"


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#23 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AAB9fRsGyhErvL18PcOcxr-p3Taix3C_ks5qKZTSgaJpZM4IzHnz
.

*THOMAS BOUTELL, *SUPPORT LEAD
P'UNK AVENUE | (215) 755-1330 | punkave.com

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants