MyShortlist 3.0 is out. It is the biggest change to MyShortlist in years: the single module that did everything is now four smaller modules, every visitor's lists are now saved in the database, the lists interface has been rebuilt, and a number of security fixes is included. This article explains what changed, why we changed it, and what you need to do.
Short version: update now, because of the security fixes. Your existing setup keeps working. When you are ready, open Components > MyShortlist > Toolkit and convert your modules.
Four modules instead of one
The original MyShortlist module could be a list, a button, a dropdown or a heart icon, depending on its Module Mode. That meant one settings page with options for every mode at once, most of which did nothing in the mode you had chosen. It also meant one large template file that branched on the mode, which made template overrides hard to write and easy to break.
So we split it. Each module now does one thing, and only shows the options that apply to it:
- MyShortlist - List: the list itself, with an optional Add button for the current item. It replaces the Default and List Only modes.
- MyShortlist - Button: an add/remove button, or a heart icon. It replaces Button Only.
- MyShortlist - Lists Dropdown: the "Add to List" button with a checkbox per list, like the one on YouTube. It replaces Dropdown Mode.
- MyShortlist - Heart Dropdown: a heart with a counter that opens the list. It replaces Heart Icon.
The parts they share (the list, the buttons, the send form, the PDF) are now Joomla layouts in the component, so you can override one part without copying a whole module template. Each module also has its own small view, overridable the standard Joomla way, at templates/<your template>/html/<module>/default.php.
Moving over takes a few clicks
The new Toolkit page in the MyShortlist component lists every old module on your site and what it becomes. Click Convert and the replacement is created with the same settings, position and menu assignment, unpublished, so you can check it before publishing it. Then unpublish the old module. If you have template overrides for the old module, the Toolkit lists them and shows where each one moves.
Your visitors keep their lists. The first time a visitor sees one of the new modules, the lists the old module kept in their browser's cookies are imported, and the old cookies are cleared once no old module is published.
What about the old module?
It still works in 3.0, but it is deprecated: it will not get new features, and it will be removed in the next major release. If you use plugin buttons on many pages ({msl_button}, Custom Blocks, the VirtueMart, Zoo or JoomMedia category buttons), keep the old module installed, even unpublished, until that release. The plugins still fall back to it in some cases, and making them independent of it is the next thing we are working on.
Every list is saved in the database
Until now, guests' lists lived in cookies, and logged-in users' lists in the database, unless you chose otherwise. Cookies are small, they are per browser, and they made lists behave differently depending on who was looking. The new modules save every list in the database. A guest is recognised by a single random token cookie, which only ever holds that token.
That also lets us look after the data properly:
- When a guest logs in, their lists move into their account.
- Guests' lists are deleted automatically once the guest has not been seen for a year. Active visitors keep theirs, because their token is renewed as they come back.
- Deleting a Joomla user deletes their shortlists too. Sent lists are kept.
A new lists interface
The multiple-lists panel has been rebuilt from scratch. Lists now open in a proper dialog, as cards with a name, an item count and an icon you pick when you create the list. It works with the keyboard and screen readers, it can no longer be covered by a template's menu or cut off by its layout, and modules that share the same lists switch together. The send-list form has had the same accessibility work.
The Favorites List page (the MyShortlist menu item) now uses the same storage and the same lists interface as the new modules, so their "View List" button always shows the same lists.
Security fixes
We went through MyShortlist looking for security problems, and fixed what we found. We recommend updating as soon as you can.
- CWE-79 (Cross-site Scripting): attackers can no longer store a script that runs in an administrator view.
- CWE-352 (Cross-Site Request Forgery): other websites can no longer make changes on your site through your visitors or administrators.
- CWE-799 (Improper Control of Interaction Frequency): your site can no longer be used to send email in bulk. Sending lists is now limited per hour: by default 5 per visitor, and 20 per IP address, so visitors sharing an office or a mobile network are not refused. You can change this in Components > MyShortlist > Options > Send Limit per Hour.
- CWE-552 (Files Accessible to External Parties): visitors' PDF exports can no longer be reached by potential attackers.
- CWE-89 (SQL Injection): database queries are now stricter about the input they accept.
If you have template overrides of the button, delbutton or actionbuttons layouts that post a form without MyShortlist's script, add <?php echo \Joomla\CMS\HTML\HTMLHelper::_('form.token'); ?> inside the form, or those buttons will stop working.
From now on, fixes and improvements go into the new modules, so we recommend converting when you can.
Smaller things
- Email Recipient can now be left empty, and lists go to your site's own address (Global Configuration > Server > Mail Settings > From Email). It used to default to
email@email.com, so if you never changed it, sent lists were bouncing. That old default now counts as empty too. Note that the Favorites List page has its own Email Recipient, in its menu item. - Category buttons (VirtueMart, Zoo, JoomMedia) now follow the list the visitor switched to.
- Ticking a list in the Lists Dropdown updates the other modules on the page straight away.
- Scripts and styles are loaded with Joomla's media version, so browsers pick up the new files right after an update.
What's next
The next release makes the button plugin and the category buttons independent of the old module, so that it can be removed. After that, we will keep modernising MyShortlist for Joomla 6 and beyond.
As always, if anything does not work as expected after updating, let us know, and we will look into it right away.