plone / plone.formwidget.autocomplete

z3c.form widget for Plone using jQuery Autocomplete
https://pypi.org/project/plone.formwidget.autocomplete
2 stars 12 forks source link

Value not saved (multilingual?) #13

Closed mauritsvanrees closed 4 years ago

mauritsvanrees commented 9 years ago

Possibly related to plone.app.multilingual; at least I only tested it there. Tired of bug hunting now, but let me at least put down some notes.

Setup scenario:

  1. Take plone.app.multilingual branch 1.x (Plone 4.3) from github, run its bootstrap and buildout.
  2. Create Plone Site, install p.a.multilingual, setup two languages. I pick Dutch and English.
  3. Create Dutch page.
  4. Create a second page, still in Dutch. (We will pick this page as English translation later, so we would have wanted to create an actual English page in the English language, but there is a problem unrelated to plone.formwidget.autocomplete there.)
  5. Return to the first Dutch page
  6. Click Actions -> Add Translations.

Now the problem: A. Use the browse button (contenttree widget) to select the second page, see that a radio button is added in the original form showing the selected page, and submit the form and all is well: the two documents are now related. B. Instead use the autocomplete input to select the second page, see that a radio button is added in the original form showing the selected page, and submit the form and all is not well: no relation has been added.

I have checked, and the radio button that is added in both these cases is exactly the same, in my case:

<input type="radio" checked="checked" name="form.widgets.content" id="form-widgets-content-0" title="None" value="/Plone/nl/soon-to-be-english-page-created-in-dutch-site" class="contenttree-widget required relationchoice-field">

So somehow the autocomplete widget does not correctly save the value.

mauritsvanrees commented 9 years ago

For completeness sake, let me say what goes wrong when doing the next steps instead of the steps 4 and 5 above:

-4. Switch language to English, create English page. -5. Switch back to Dutch and go to the Dutch page.

A problem then appears on the 'Add Translations' page. The browse button works fine and can find the English page in the English folder (which is a navigation root) just fine. But the autocomplete only finds documents in the Dutch navigation root. I know three small changes that I could do in plone.app.multilingual to fix that, but then the roles are reversed: the browse button does not work anymore...

Fixes in p.a.multilingual would be:

jensens commented 4 years ago

still an issue?

mauritsvanrees commented 4 years ago

I just now tried it in an old site with old versions and there the problem still exists. But the customer has not complained. Or maybe they did years ago, but I can't remember.

It probably works fine on master. I will close this and the related linked issue.