Library upgrade: remove jquery deprecations

Bug #1843357 reported by Rebecca Blundell
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
Fix Released
High
Rebecca Blundell

Bug Description

This is related to https://bugs.launchpad.net/mahara/+bug/1840105

Jquery 3.4.0 deprecated quite a few selectors that we use. However there are no warnings and the removal of related code is not scheduled until 4.0. For that reason I am creating a new bug as a reminder to fix this while I move on with other upgrades.

Deprecations: https://api.jquery.com/category/deprecated/deprecated-3.4/
Changelog: https://blog.jquery.com/2019/04/10/jquery-3-4-0-released/
Basic example: https://forum.jquery.com/topic/jquery-3-4-replacement-examples-for-deprecated-positional-selectors-first-last

So the idea is to replace the selectors with the jquery methods first(), last() and eq(), and/or to use equivalent css selectors.

Revision history for this message
Mahara Bot (dev-mahara) wrote : A patch has been submitted for review

Patch for "master" branch: https://reviews.mahara.org/10322

Changed in mahara:
status: New → In Progress
importance: Undecided → High
milestone: none → 19.10.0
Changed in mahara:
assignee: nobody → Rebecca Blundell (rjb-dev)
Changed in mahara:
milestone: 19.10.0 → 19.10.1
Changed in mahara:
milestone: 19.10.1 → 19.10.2
Revision history for this message
Rebecca Blundell (rjb-dev) wrote :

This patch touches a lot of areas of Mahara, which I have tried to test comprehensively. Here are some notes of what I did and didn't test:

account/index.php
Change your username.
Refresh the page.
Your new username should appear in the Online users box in brackets next to your name.
There should not be console errors.

htdocs/artefact/resume/lib.php
Go to the Education and Employment page. Add a couple of qualifications. Confirm there are no console errors

Fancybox
Add a block to a page with a gallery of images in it. Clicking on each image should expand it into the middle of the page with the rest of the page shaded out.

Jsoneditor
Check that the copy and edit buttons work as expected and clear on page reload.

Jquery-ui
Use Gridstack to change the size of boxes and move them around the page.
Check for console errors.

htdocs/theme/raw/templates/form/userlist.tpl
Check that the page for adding users to an institution populates correctly and that members can be added/invited without errors.

In the following files a variable called $offset was required to be >0 for the changes to run.
Without replicating the circumstances I hard-coded it up and checked the code ran without errors.
Make sure skins are enabled in config.php
Go to http://mahara/admin/site/fonts.php
groupviews.php
Go to http://mahara/admin/site/views.php

htdocs/admin/extensions/plugins.php - not tested. Looks like it requires install of a new plugin to achieve.

Couldn't test http://mahara/admin/users/statistics.php
could see the statistics table, but not .btn.filter

elasticsearch
focus is the first search element - not tested.

Changed in mahara:
milestone: 19.10.2 → 20.04.0
Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/10322
Committed: https://git.mahara.org/mahara/mahara/commit/15ed3e6e118a3ecd861d20611317e835e1e54420
Submitter: Cecilia Vela Gurovic (<email address hidden>)
Branch: master

commit 15ed3e6e118a3ecd861d20611317e835e1e54420
Author: Rebecca Blundell <email address hidden>
Date: Tue Sep 10 12:44:52 2019 +1200

Bug 1843357: Remove deprecated jquery selectors

These are:
:first -> .first() or css first-child
:last -> .last() or css last-child
:eq -> .eq() or css nth-of-type(n)
:even -> css nth-child(odd) (odd because we're
going from 0->1 based indexing)
And these which were not found in Mahara:
:odd
:gt
:lt

Change-Id: I512db61de687f9ea3d7a31b1514f4aa962bcb1b0

Changed in mahara:
status: In Progress → Fix Committed
Changed in mahara:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.