Skip to content
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

Release v2.45.0 broke the ability to add nutrients and other features are showing issues #10861

Closed
October-Food-Facts opened this issue Oct 2, 2024 · 13 comments · Fixed by #10924

Comments

@October-Food-Facts
Copy link

October-Food-Facts commented Oct 2, 2024

Release v2.45.0 broke some of the site's functionalities.

The ability to add nutrients, such as vitamins and minerals, is broken. The input field in the screenshot with the placeholder text "Add a nutrient" does not work properly anymore as of the latest release.
Image

The checkbox with "Nutrition facts are not specified on the product" isn't behaving properly as it was anymore. When toggled, it no longer collapses (hides) its respective section in full as it did before, even after saving changes and returning to edit again.

The checkbox with "Nutrition facts are specified for the product as sold" also isn't behaving properly as it was anymore, even though it's hard to tell. It appears that when it arrives unchecked by an app contribution, toggling it no longer opens up the nutrition table, making it impossible to fill-in values on it. The page has to be saved for the table to become available upon returning to edit again.

Furthermore, as of this release, one is unable to add Folksonomy properties, which stopped working. It seems similar to the nutrients issue because it involves dropdown suggestions.

The release also broke the Folksonomy panel layout, while it moved the search bar in table list pages to the left side, needing a bit of habituation to it.

@aleene aleene added the impact label Oct 4, 2024
@github-actions github-actions bot added the ⭐ top issue Top issue. label Oct 5, 2024
@October-Food-Facts October-Food-Facts changed the title Release v2.45.0 broke the ability to add nutrients Release v2.45.0 broke the ability to add nutrients and other features are showing issues Oct 6, 2024
@October-Food-Facts
Copy link
Author

I updated this with more issues. :)

@jayaddison
Copy link
Contributor

I encountered this problem earlier today, when attempting a daily data-quality task.

One thing I noticed in my Firefox developer console when taking a look for JavaScript errors: there was an error message about uniqueSort not being an available (jQuery) function.

It seems uniqueSort was removed from jQuery a long time ago, however the jQuery-UI library (used by OFF) provides some 'patch' functionality to insert a substitute for it (called a polyfill in JavaScript terminology).

That polyfill was disabled by default in jQuery-UI version 1.14, that we upgrade to recently (#10681) -- so I would guess that that is a possible candidate for what caused the error.

I don't know if that error could cause the entirety of this failure to load the nutritional prompts, but it seems possible.

The upgrade guide mentions a jQuery.uiBackCompat setting that can be enabled -- that might provide a short-term fix, although it would be preferable to try to remove reliance on any long-removed jQuery features.

I'll try to investigate further soon.

@CharlesNepote
Copy link
Member

It also breaks folksonomy engine.

@Valimp
Copy link
Collaborator

Valimp commented Oct 9, 2024

According to the Jquery ui documentation a file name was changed. I think that's where the problem comes from.
I'm going to investigate this JS import
jQuery-ui documentation

@Valimp
Copy link
Collaborator

Valimp commented Oct 10, 2024

we investigated with @raphael0202,

"Only the latest jQuery version within each major version of jQuery is supported. To make updates easier, we also run tests with a few other relatively recent versions, but we don't guarantee continued support for them in all jQuery UI releases in the 1.14.x line. Each jQuery UI version will document on which jQuery versions it was tested - both in the release blog post and in the changelog page at https://jqueryui.com/changelog/."

But current version of jQuery is 2.1.X when it should be 2.2.4
Moreover it seems that "foundation-sites" force jQuery version to 2.1.X and that need more works to fix that because of very old version of this dependencie (9years for the last update)

A quick fix is to downgrade jquery-ui version

@CharlesNepote
Copy link
Member

A quick fix is to downgrade jquery-ui version

Yes please. The lack of auto completion is very anoying for many contributors.

You can try other solutions later, but the quick fix should be applied IMHO.

@jayaddison
Copy link
Contributor

From some investigation here:

  • Enabling \$.uiBackCompat does not appear to affect on this bug - so my apologies for that, it was not relevant.

  • We are using jQuery v2.1.4, and it provides a $.uniqueSort function, from the included Sizzle library.

  • jquery-ui v1.14.0 removes auto-creation of $.uniqueSort -- but... that function should already exist in jQuery v2.1.4 -- so I don't understand why that change would cause a problem for us?

  • $.unique -- the old/legacy name for this function -- is defined in the browser console.

@jusdekiwi
Copy link

Has anyone found a solution? :(

@jayaddison
Copy link
Contributor

The recent 2.46.0 release (#10858) did have some effect on this: the autosuggest selection prompt does now appear -- but there is still a problem trying to select a nutrient (I was trying this in Firefox).

Clicking on the item from the autosuggestion list does not select the value, and the autosuggest menu stays open:

issue-10861-post2.46.mp4

(it's not clear from the video itself, but I attempt to click on the item while it is highlighted in blue multiple times)

The following error appears in the JavaScript console:

Uncaught TypeError: e.ui.safeActiveElement is not a function

@jayaddison
Copy link
Contributor

I tested this locally and was able to replicate the same problem.

Then I took a look at the source control history for gulpfile.ts, because I found a report of a similar problem on GitHub, and it related to the order in which dependencies are added (I didn't read the code of their eventual fix, but it did help to get ideas for what the problem might be).

Looking at the git logs, #10708 seemed relevant, so I tried reverting that, and it fixes the autosuggest problem when I test it locally:

pr-10708-revert-testing.mp4

I haven't yet confirmed that this repairs the Folksonomy engine functionality, but I will attempt to do that soon. (there are some CORS errors that appear in my dev instance that I'll need to resolve first, I think)

I'll open a pull request with a revert for #10708 soon.

@jayaddison
Copy link
Contributor

Release 2.47.0 containing the anticipated fix #10924 has been deployed to production, but I'm still unable to select nutrient names after they appear in the drop-down list. So this issue does not appear to be resolved yet :/

Could we reopen the bugreport?

@jusdekiwi
Copy link

I've just checked and it works for the NF drop-down menus and for Folksonomy as well! Thanks! 🥳

@jayaddison
Copy link
Contributor

Yep, I can confirm that nutrient selection is working for me now too 👍

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