using URLSearchParams to get url parameters in js

Bug #1852026 reported by Cecilia Vela Gurovic
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
Fix Released
Low
Cecilia Vela Gurovic

Bug Description

we have a function in js/mahara.js called getUrlParameter(param, url)

We should update that one to use this " new URLSearchParams() " seen as it's valid for every browser except old IE (which we don't support) https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams

Actually we could also update our updateUrlParameter() as the URLSearchParams() can do get() and set()

Changed in mahara:
importance: Undecided → Low
status: New → Confirmed
milestone: none → 20.04.0
Changed in mahara:
assignee: nobody → Cecilia Vela Gurovic (ceciliavg)
status: Confirmed → In Progress
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/10695

Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/10695
Committed: https://git.mahara.org/mahara/mahara/commit/a94f1fa1899679e73dea315400365d8b2e1e2930
Submitter: Robert Lyon (<email address hidden>)
Branch: master

commit a94f1fa1899679e73dea315400365d8b2e1e2930
Author: Cecilia Vela Gurovic <email address hidden>
Date: Tue Dec 31 10:24:13 2019 +1300

Bug 1852026: refactor getUrlParameter(param, url)

to use JS function URLSearchParams. The result should stay the same, it should not change any behaviour.

The function is used in :
./htdocs/relatedtags.php
./htdocs/tags.php
./htdocs/js/adminusersearch.js
./htdocs/js/export.js
./htdocs/js/privacy.js
./htdocs/js/adminexportqueue.js
./htdocs/artefact/annotation/blocktype/annotation/js/annotation.js
./htdocs/artefact/plans/js/planview.js
./htdocs/artefact/peerassessment/blocktype/peerassessment/js/peerassessment.js
./htdocs/artefact/file/js/filebrowser.js
./htdocs/theme/raw/js/formtabs.js
./htdocs/view/choosetemplate.php

the function updateUrlParameter is used in:
./htdocs/relatedtags.php
./htdocs/js/privacy.js
./htdocs/js/mahara.js
./htdocs/artefact/file/js/filebrowser.js

behatnotneeded

Change-Id: I1593f59624a5de3f90054a702d4e94dd7029f321

Robert Lyon (robertl-9)
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.