While adding more and more Playwright tests for VirtueMart 5, I had the idea to port them also to VirtueMart 4. So this version got tested with 98 tests: 98 tests on Joomla 3 and 98 tests on Joomla 5. Of course these tests cannot check every detail, and also not every option. These tests are mainly for the 2–3 typical ways to configure VM. But for example most SEO configurations and use cases are tested. Also full pagination tests and sorting.
Furthermore findings in VirtueMart 5 due to the type hints were often also suitable for VM4, so a lot of smaller fixes and feature requests got backported. For example the new vmDefines uses the same new lazy-loading technique for class aliases. Normal class aliases directly load the class, not the lazyload list technique. This saves up to 2 MB and more. It also ensures enhanced compatibility for extensions which got adjusted to Joomla 6. This is important for developers. It is also more likely that smaller plugins just run on VM5 without any fixes. I also backported the new knowledge to the table updater.
24 of the 98 tests were for PayPal Checkout. It is also completely updated with enhanced features and some fixes.
VirtueMart 5 is on its way. There is a new release candidate for testing. I will write an own news for it. This is a release candidate, that means it is for testing, not for live shops
We have again some minor security fixes.
(the rest, written by Grok and reviewed by Max Milbers)
Security fixes
- Stored configuration and plugin parameters. An old
unserializeon values VirtueMart had stored itself could build PHP objects. The shop writes those values, so this was not exploitable here. The read is closed anyway and no longer creates objects. - Backend log. Downloading or deleting a log file requires the administrator form token.
- Media files. A stored path that is a directory is not opened as a file. The thumbnail is written next to the stored file. An uppercase extension still matches on Linux. A directory is also not treated as an existing image file when the sized copies are listed.
- PayPal (classic). The IPN is verified on
ipnpb.paypal.com, and onipnpb.sandbox.paypal.comfor the sandbox. The old list of PayPal server IPs is gone. This is the classic PayPal plugin, not PayPal Checkout. - Add to cart and checkout tokens. A full-page cache can no longer freeze an old token into the button. Javascript writes the current token. The add-to-cart check stays on.
New features
- AVIF. Product images can be uploaded as AVIF, and VirtueMart creates the thumbnail. WebP, AVIF and SVG get a stored mime type when the media row has none.
- Tokens for cached pages. The configuration "Add missing token to checkout and add to product to cart" covers the add-to-cart button as well as the checkout. Enable it when product modules are cached.
Interesting for shopowners
- Checkout confirm. The confirm hash includes the bill-to address again, and the ship-to address when it differs. Changing the address, the currency, the coupon, the shipment or the payment invalidates the approved cart. Confirm sends that cart to the order-done page as a normal request. Ajax checkout stays available for the other steps.
- Guest registration. The guest customer number stays stable and is copied onto the cart after registration. The guest cart token is refreshed at the same time, so the next step is not rejected.
- Account form. A logged-in shopper sees Save on the legacy account layout.
- Coupons. A coupon already stored in the cart is checked again without the "coupon accepted" message. A coupon that no longer fits the cart is dropped.
- Child products. Collecting child ids compares the child id. The old test overwrote it, so children were missed.
- Order edit. "Apply no rule" on an order line no longer fatals. The tax rule of a new line is stored on that line. The tax dropdown is initialised when the line is added. The status list checks the right row and sets Notify on the checkbox.
- Addresses. The address of a logged-in shopper is not treated as a guest prefill.
- Phone, mobile and fax. A leading plus, a slash and a hyphen are kept. A trunk prefix
(0)is removed first. - Weight. The cart weight stays on the cart when the products are loaded. An empty weight unit or dimension unit returns the amount unchanged.
- Child links in the Bootstrap 5 layout. A child-variant URL no longer gains a trailing zero when the page has no menu item. That zero sent the shopper to the category.
- Product menu and pagination. A product menu item is applied before Joomla reads the Itemid. A menu item with no extra segments opens on the first page.
- Product name. The product edit shows the name from the fallback language when the current language has none.
- Updates. An extension that the all-in-one installer updates is marked installed.
- Uploads. A file that collides with an existing name is stored under a short new name, and that name is reported.
- All-in-one installer. Sofort is no longer installed. The Moneybookers-to-Skrill migrator is removed.
- Multi-image upload. The scripts load before the page is ready, so the second image does not wait on a ready handler that already ran.
- Admin menu after an update. A Joomla menu row whose level is 0 is rebuilt before the VirtueMart admin menu is written.
- Account activation. A shopper who must activate the new account is not logged in at registration. The customer number stays on the cart, and the order is stored for that account, so the activation mail can still do its job.
- Terms of service. The article comes from the userfield default, an article id or an alias. The checkbox is no longer ticked only because that default is set. A second terms field follows the same rule.
- Category products. A product that did not load is left out of the category. Content plugins are not run on a value that is not a product.
- Product images. The images stay in the order that was posted. A new upload is added at the end. The separate ordering list is not applied on save.
- Browse fields. Clearing every browse sort field, or every browse search field, stores an empty list. The previous list is not kept when the form omits it.
- Cart layout. In the Bootstrap 5 cart, shipment, payment, and the totals sit in the purchase column. The PayPal login button is not shown inside the cart login box.
- Related products. On the vmadmin product edit, an extra related-product field keeps its stored type. Its search box works after the field is added.
- PayPal Checkout. Card fields are shown when the card method is selected, and PayPal is asked for strong customer authentication on every card payment. The check reads the authentication status. Confirm without card data stays on the cart. If PayPal sends no order id, the shop shows a message. Pay upon invoice requires the dial code, the phone number, and the date of birth. Sofort and giropay are no longer funding sources. The method warns when a price breakdown is on and prices are rounded only for display. Card fields and Ratepay fields are shown only for the selected method. An open capture can be retried from the order, and the shop can retry open captures on a schedule.
Interesting for developers
_JEXECreplacesJPATH_PLATFORMin the custom fields, the toolbar and the horme_3 pagination layout.- Category dropdown. The script can load outside the administrator.
- Key file. A newly created key file records the encryption method.
- Cart hash.
getCartHashis built from named parts (products, addresses, currency, coupon, shipment, payment, customer number, vendor). The cart module can hash without prices.viewJSCheckoutreturns the cart aftercheckoutData(false). - Table update.
SHOW COLUMNSis compared withinstall.sql, so an implicit NULL matchesDEFAULT NULL. An old default is dropped before aDEFAULT NULLchange. Existing NULLs are filled before a column becomesNOT NULL. TEXT and BLOB are retried withoutDEFAULT NULL. The update stops whenalterKeyruns out of time. - Browse layout. The category layout owns the browser-state switch. The form sentinel overrides it.
- Add-to-cart bar. The layout calls
shopFunctionsF::renderVmSubLayout. The oldself::call only worked because the file was included. - Legacy category heading uses the class
vm-category-title. The classic look does not change. The class is the same hook the Bootstrap 5 layout already had. - Template id. A home template without an id is stored as 0.
- Debug mail. The captured mail body is shown as text.
- Add-to-cart token.
checkTokenATCstays enabled. Turn it off only when a cache injects the token itself. - Empty integer.
getIntreturns an empty string when the request value is empty. It does not return 0, so a layout that concatenates the value no longer adds a trailing zero to the product id. - State field.
getStateFieldByIDreturns one field of a state, in the same way asgetCountryFieldByID. - Cross-reference. A posted key of 0, or an empty posted key, is stored. It is no longer dropped.
- Plugin updater. The update loader imports
JPlugin,JFactory,JInstaller, andJRoutefromJoomla\CMS. It runs before the old class names are registered. Joomla 3.10 still maps those old names. - Registration debug mail. When debug mail is on, the printed registration mail fills its
{NAME}tags before the text is shown.
Just fixes / enhancements
- Backend redirect after a save, the return address after a failed token, the media AJAX token, and the add-to-cart token markup.
- Category recursion receives the arguments it expects.
- Custom-field layout in the backend, and media asset paths.
- The vmadmin layout uses the class
uk-grid. The UIKit grid attribute is gone. The old implementation could lead to a memory leak. - The category search-field list in the configuration no longer starts with a forced "none" entry.