Appearance
<div style="display: none;" hidden="true" aria-hidden="true">Are you an LLM? You can read better optimized documentation at /changelog/Changelog.4.126.md for this page in Markdown format</div>
Version 4
version 4.126
- [4.126.0] fix(eshop): product and blog hit counters are now incremented atomically (#667).
Adv_product_model::updateHits()andAdv_blog_model::updateBlogHits()run a singleUPDATE ... SET hits = hits + 1(CI3set('hits', 'hits + 1', false)) with no prior read, so concurrent views of the same product or article no longer lose increments. The per-view full-rowSELECT *is gone, so each view runs one statement instead of two. A missing id still matches no row, so the call remains a no-op, and the signatures are unchanged. This matters becausehitsorders related products by default, the storefront "Popular" sort and the shipped default category/vendor sort. - [4.126.0] feat(referrer): storefront orders arriving from TikTok (channel 7) and ChatGPT (channel 8) are now attributed — two new
$config['referrerChannels']entries inapplication/config/app.php(keystiktok/chatgpt, priority 2, 1-dayexpiresIn) with admin icons, recorded inshop_order.skroutz_refererlike the existing channels. No migration (#816) - [4.126.0] fix(eshop): the product parser now works with integer product ids only (#909). Gift choice ids are cast to int where
AdvCartResource::getGifts()merges them into the cart id list.Adv_product_parser_modelnormalises incoming ids to unique positive ints through a new protectednormalizeProductIds()atget()andgetLiveAvailability(), andbuildSql()/getProductStocks()emit integer literals only. This keeps theproduct_idindex usable (a mixed int/stringINlist was compared as DOUBLE, the same bug class as #836) and removes a latent SQL-injection sink (a rawimplodeof unvalidated ids). Behaviour note: invalid ids (non-numeric,0, negative,'1e3','5.5', arrays, bools) are dropped, never mapped to0. An all-invalid list returns no products and runs no query; a directbuildSql()call with no valid ids emitsWHERE 1 = 0. - [4.126.0] fix(product): make the storefront old-URL redirect lookup an index seek instead of a full catalogue scan (#471).
Adv_eshop::baseProduct()→Adv_product_model::findSlugsByUrl()runs on every catch-all miss (category pages, /cart, /login, /account, 404/crawler hits) and used a non-sargableTRIM(BOTH '/' FROM shop_product_mui.url) = ?on an unindexed text column (~4.7 s per miss on a 1.86M-row tenant). It now matchesurl = ?ANDlang = <active language>against the newurl_langindex. Behaviour narrowing: aurlstored only on another language's row no longer triggers the redirect. - [4.126.0] fix(rest): the product write endpoint now stores
translations[].urlwithout leading/trailing slashes (same as admin), so the old-URL redirect keeps matching (#471) - [4.126.0] feat(rest/checkout):
POST /rest/checkout/vat-number(guest) validates a VAT number (ΑΦΜ) for a headless invoice checkout with three outcomes,valid,invalidandunverified, and never fails open: format and, for Greece, the ΑΦΜ check digit are tested offline first (no network call), then AADE RgWsPublic2 for Greek numbers when the merchant has configuredVAT_CHECKER, then the European Commission's VIES REST API. A timeout, error status, VIES error body or non-EU country isunverified, nevervalid. Answers are cached briefly per (country, number) and registry lookups are throttled per IP and per number (#891) - [4.126.0] fix(rest/checkout):
POST /rest/checkout/place-orderdocuments its invoice fields (wantsInvoice,afm,doy,company,profession,companyAddress) in the OpenAPI request schema, where they were missing since #760, and refuses a Greek invoice (billing country GR) whose ΑΦΜ fails the official mod-11 check digit with 422invoice_afm_invalid({code, field: 'afm'}). The check digit now has one home,Advisable\Domains\Tax\VatNumber\GreekAfm, whichAdvVatValidate::validateGreekVat()delegates to, and it no longer accepts a value with a trailing newline (#890) - [4.126.0] feat(rest/storefront-config):
GET /rest/storefront-configpublishes the merchant's shippable countries ascheckout.availableCountries—ESHOP.AVAILABLE_COUNTRIES, the list set in admin and already offered by the legacy checkout, as uppercase ISO alpha-2 codes in admin order, read live. An absent or empty setting answers[], meaning no restriction configured; it is never filled fromconfig('available_countries'). A headless checkout no longer has to list every country and discover at the shipping quote that no courier serves it (#889) - [4.126.0] fix(customer): social login no longer signs in as a typed email address; it requires a provider-verified email, and a disabled provider answers 404 (#892)
Notes
- [4.126.0] No fork overrides
updateHits,updateProductHits,updateBlogHitsorupdateArticleHits, and no protected signature changed, so the fix reaches every fork automatically. - [4.126.0] On a client database where
hitsis nullable and holds NULL rows,hits + 1keeps them NULL. The repo schema isNOT NULL DEFAULT 0. - [4.126.0] Check for overrides:
$config['referrerChannels']inapplication/config/app.php(:376-433as of #816) gains7 => tiktok(:412-418, between6 => bestpriceand2 => fedra) and8 => chatgpt(:426-432, appended last, after2 => fedra). Channel ids are stored inshop_order.skroutz_refererand in the customer LAST.REFERRAL tags (tag_id), so an id a fork already uses must never change meaning. A fork that already has its own channel on id 7 or 8 keeps its ids and re-ids upstream's TikTok / ChatGPT instead; any free id works, because matching goes bykey, not by id. In that case, adapt the ids pinned intests/Legacy/Eshop/ChannelTrackTest.phpto match.- v4-pharmacy-discount already ships
7 => tiktokbyte-identically, plus the identicalpublic/ui/admin/img/tiktok-32x32.png. Its merge is clean; the config only gains8 => chatgpt. - v4-dioptra uses
7 => linkwiand8 => 'TikTok', both after2 => fedra. The capitalised key has never matched automatically (matching is a case-sensitivestrposonkey, and browsers send lowercase hosts), but id 8 is in use: dioptra's ownapplication/views/admin/orders/create.phpoffers everyreferrerChannelsentry in its order-type select, so staff-entered TikTok orders are stored as8. The merge conflicts at the end of the array (upstream's8 => chatgptagainst dioptra's7and8), and upstream's7 => tiktokmerges in silently above2 => fedra, with no conflict marker. PHP raises no error for a duplicate array key and keeps only the last one, so keeping both sides of the conflict leaves duplicate ids7and8and silently loses a channel. Resolve it as follows:- Delete upstream's
7 => tiktokblock above2 => fedra: it is the shadowed one, because dioptra's own7 => linkwicomes later in the array and wins. - Keep
7 => linkwi. - Keep TikTok on
8, with its key fixed to'tiktok'and its icon set to/ui/admin/img/tiktok-32x32.png. The icon change is needed as well as the key: its current icon,/ui/main/img/tiktok_icon.svg, is an SVG, whichgetimagesize()cannot read, and the new test's icon check runs over every channel in the array. - Give ChatGPT a free id, e.g.
9. - Adapt
tests/Legacy/Eshop/ChannelTrackTest.php, which pins upstream's ids 7 and 8: TikTok becomes8and ChatGPT9in its expectations. - Side effect to expect: that order-type select prints each entry's raw
key, so it now lists ChatGPT too and shows TikTok astiktok.
- Delete upstream's
- v4-pharmacy-discount already ships
- [4.126.0] UI Update: new admin icons
public/ui/admin/img/tiktok-32x32.pngandpublic/ui/admin/img/chatgpt-32x32.png. An order attributed to TikTok or ChatGPT shows its icon in the admin orders list (the tooltip and the order modal give the domain) and is found through the orders referrer filter, whose labels read "Tiktok" and "Chatgpt" (the channelkeythroughucfirst). The customer view, the customer referrer chart, the referrer reports, the DataboxReferrerreport and the audience LAST.REFERRAL tags name the channel by its domain,tiktok.com/chatgpt.com. - [4.126.0] Known limits: matching is unchanged, so
chat.openai.com(its host parses asopenai) and app referers such asandroid-app://…are not attributed to either channel, and mobile apps often send no Referer at all, so visits that start inside the TikTok or ChatGPT app are undercounted. - [4.126.0] Check for overrides:
Adv_product_parser_model::get()— forks that override it with a full copy not callingparent::get()(Blustore, Edructer, Flioukas, Nautilus, OptikaLiolios, Smile) should replace theirarray_uniqueline with$this->normalizeProductIds($productIds);they still get thebuildSql()guard for the product-row query without it. - [4.126.0] Check for overrides:
Adv_product_parser_model::getProductStocks()— forks that override it with their own rawimplode(Blustore, Dioptra, Edructer, Elxis) stay unprotected for the stock query and should normalise the ids the same way. - [4.126.0] No fork overrides
buildSql(),getLiveAvailability()orCartResource::getGifts(), so those fixes reach every fork automatically. The new protected methodnormalizeProductIds($productIds): arrayis additive. - [4.126.0] REQUIRES
php migrator.php migrate:20261006120000_add_url_lang_index_to_shop_product_mui.php— first trims leading/trailing/from legacyshop_product_mui.urlvalues (chunked by primary key), then addsINDEX url_lang (url(191), lang)using online DDL (ALGORITHM=INPLACE, LOCK=NONE, plain ALTER fallback). Skipped whenurl_langor any index leading withurlalready exists.down()drops the index; the trim is not reversed. On large tenants the index build takes time on a multi-GB table.
- [4.126.0] Check for overrides: forks overriding
Adv_eshop::baseProduct()with thefindSlugsByUrl()lookup commented out as a temporary fix (e.g. Evripidis,8a9277534inapplication/modules/eshop/controllers/Eshop.php) can drop that override after merging this release. - [4.126.0] Check for overrides: forks that write
shop_product_mui.urlthemselves (custom importers or an override ofProduct\MuiWriteData) must store it without leading/trailing/, otherwise the redirect stops matching. - [4.126.0] Check for overrides: a fork that already has its own index leading with
urlkeeps it (the migration skips); verify its prefix length covers the lookups. - [4.126.0] UI Update: REST contract note 1.109. New endpoint
POST /rest/checkout/vat-number, body{country, vatNumber}, answer{country, vatNumber, status, source, name, address, doy, profession}. Showname/addressto prefill the invoice form only onvalid; onunverifiedlet the customer continue and say the number could not be checked; a 429 (withRetry-After) means "treat as unverified". Persist the returnedvatNumber(normalised), not the raw input.doyandprofessionare filled only when AADE answered. The legacy storefront check (POST /api/validateVat) is unchanged and still fails open. - [4.126.0] Check for overrides: none. New classes only (
Advisable\Domains\Tax\VatNumber\*,Advisable\Rest\Checkout\Controllers\VatNumber); no existing public or protected method changed. Depends onAdvisable\Domains\Tax\VatNumber\GreekAfm(#890). - [4.126.0] Optional env tuning:
VAT_NUMBER_CACHE_TTL_SECONDS(600),VAT_NUMBER_UNVERIFIED_CACHE_TTL_SECONDS(30),REST_VAT_NUMBER_THROTTLE_MAX_PER_IP(30),REST_VAT_NUMBER_THROTTLE_MAX_PER_NUMBER(5),REST_VAT_NUMBER_THROTTLE_WINDOW_SECONDS(60),REST_VAT_NUMBER_THROTTLE_ENABLED(true). The per-IP limit countsREMOTE_ADDR, as the login throttle does. Behind a load balancer or CDN withproxy_ipsempty, that is the proxy's address, so all guests share one bucket of 30 lookups per minute. With the default file cache the counters are also per container, and shared across pods only on Redis. - [4.126.0] AADE is asked first: a Greek number goes to AADE before VIES when
VAT_CHECKERcredentials are configured, because only AADE returnsdoyandprofession. Every uncached AADE lookup notifies the looked-up business, which the cache and throttle limit. AADE never answersinvalid, so a number that passes the check digit but is not registered costs one AADE call and one notification, then a VIES call. Run one live lookup with the real credentials after deploy: the AADE path was not tested against the live service. - [4.126.0] UI Update: REST contract note 1.108. A GR-billed invoice must carry a valid ΑΦΜ, sent without spaces; a client sending an invalid one now gets 422
invoice_afm_invalidinstead of an order. A non-GR or missing billing country is not checked. No network call is made. This also applies to apps that call place-order directly, such as the WeCare app, which already applies the same rule (velora-wecare-experiment #411). - [4.126.0] Check for overrides:
Advisable\Domains\Checkout\PlaceOrderService(new check after the invoice-presence check) andAdvVatValidate::validateGreekVat()(now delegates toGreekAfm::isValid(), same signature). A fork overriding either should adopt the same rule so legacy and REST keep agreeing. One legacy result changes:validateGreekVat()now rejects a value with a trailing newline (for example"12345678\n"), which it used to accept; a clean ΑΦΜ gives the same result as before. - [4.126.0] UI Update: REST contract note 1.107, additive.
GET /rest/country/countryis unchanged and still unfiltered; a headless country picker should intersect it withcheckout.availableCountrieswhen that list is non-empty. - [4.126.0] Security: the storefront social-login fallback
customer/requestEmailsigned the visitor in as a typed email address. It is removed. Google sign-in now requires Google'semail_verifiedclaim; Facebook's email is used as returned, since the Graph API carries no verification flag. Ship as an expedited patch. - [4.126.0] Check for overrides:
Adv_customer::requestEmail()— removed, with its_remaproute. A fork overriding it, or redirecting tocustomer/requestEmail, must drop that code - [4.126.0] Check for overrides:
Adv_customer::oAuth2Login()— no longer redirects tocustomer/requestEmail; refuses through the newrefuseSocialLogin()and accepts onlyverifiedSocialLoginEmail(), which refuses any resource owner other thanGoogleUser/FacebookUser. A fork adding a provider must overrideverifiedSocialLoginEmail() - [4.126.0] Check for overrides:
Adv_customer::googleLogin()/facebookLogin()— now 404 unlessSOCIAL_AUTH.GOOGLE_LOGIN_ENABLED/FACEBOOK_LOGIN_ENABLEDis on - [4.126.0] UI Update:
customerRequestEmaillayout removed fromtemplate.json/mainTemplate.jsonwith its views (main/layouts/customer/request_email.php,default/layouts/library/customer/request_email.phpand its empty_request_email.scss). Translation keycustomer.login.requestEmailreplaced bycustomer.login.social.error, shown on the login page through thelogin_messageflashdata