Skip to content

<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>

Home | Changelog

Version 4 ​

version 4.126 ​

  • [4.126.0] fix(eshop): product and blog hit counters are now incremented atomically (#667). Adv_product_model::updateHits() and Adv_blog_model::updateBlogHits() run a single UPDATE ... SET hits = hits + 1 (CI3 set('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-row SELECT * 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 because hits orders 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 in application/config/app.php (keys tiktok / chatgpt, priority 2, 1-day expiresIn) with admin icons, recorded in shop_order.skroutz_referer like 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_model normalises incoming ids to unique positive ints through a new protected normalizeProductIds() at get() and getLiveAvailability(), and buildSql() / getProductStocks() emit integer literals only. This keeps the product_id index usable (a mixed int/string IN list was compared as DOUBLE, the same bug class as #836) and removes a latent SQL-injection sink (a raw implode of unvalidated ids). Behaviour note: invalid ids (non-numeric, 0, negative, '1e3', '5.5', arrays, bools) are dropped, never mapped to 0. An all-invalid list returns no products and runs no query; a direct buildSql() call with no valid ids emits WHERE 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-sargable TRIM(BOTH '/' FROM shop_product_mui.url) = ? on an unindexed text column (~4.7 s per miss on a 1.86M-row tenant). It now matches url = ? AND lang = &lt;active language> against the new url_lang index. Behaviour narrowing: a url stored only on another language's row no longer triggers the redirect.
  • [4.126.0] fix(rest): the product write endpoint now stores translations[].url without 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, invalid and unverified, 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 configured VAT_CHECKER, then the European Commission's VIES REST API. A timeout, error status, VIES error body or non-EU country is unverified, never valid. 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-order documents 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 422 invoice_afm_invalid ({code, field: 'afm'}). The check digit now has one home, Advisable\Domains\Tax\VatNumber\GreekAfm, which AdvVatValidate::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-config publishes the merchant's shippable countries as checkout.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 from config('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, updateBlogHits or updateArticleHits, and no protected signature changed, so the fix reaches every fork automatically.
  • [4.126.0] On a client database where hits is nullable and holds NULL rows, hits + 1 keeps them NULL. The repo schema is NOT NULL DEFAULT 0.
  • [4.126.0] Check for overrides: $config['referrerChannels'] in application/config/app.php (:376-433 as of #816) gains 7 => tiktok (:412-418, between 6 => bestprice and 2 => fedra) and 8 => chatgpt (:426-432, appended last, after 2 => fedra). Channel ids are stored in shop_order.skroutz_referer and 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 by key, not by id. In that case, adapt the ids pinned in tests/Legacy/Eshop/ChannelTrackTest.php to match.
    • v4-pharmacy-discount already ships 7 => tiktok byte-identically, plus the identical public/ui/admin/img/tiktok-32x32.png. Its merge is clean; the config only gains 8 => chatgpt.
    • v4-dioptra uses 7 => linkwi and 8 => 'TikTok', both after 2 => fedra. The capitalised key has never matched automatically (matching is a case-sensitive strpos on key, and browsers send lowercase hosts), but id 8 is in use: dioptra's own application/views/admin/orders/create.php offers every referrerChannels entry in its order-type select, so staff-entered TikTok orders are stored as 8. The merge conflicts at the end of the array (upstream's 8 => chatgpt against dioptra's 7 and 8), and upstream's 7 => tiktok merges in silently above 2 => 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 ids 7 and 8 and silently loses a channel. Resolve it as follows:
      1. Delete upstream's 7 => tiktok block above 2 => fedra: it is the shadowed one, because dioptra's own 7 => linkwi comes later in the array and wins.
      2. Keep 7 => linkwi.
      3. 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, which getimagesize() cannot read, and the new test's icon check runs over every channel in the array.
      4. Give ChatGPT a free id, e.g. 9.
      5. Adapt tests/Legacy/Eshop/ChannelTrackTest.php, which pins upstream's ids 7 and 8: TikTok becomes 8 and ChatGPT 9 in its expectations.
      6. Side effect to expect: that order-type select prints each entry's raw key, so it now lists ChatGPT too and shows TikTok as tiktok.
  • [4.126.0] UI Update: new admin icons public/ui/admin/img/tiktok-32x32.png and public/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 channel key through ucfirst). The customer view, the customer referrer chart, the referrer reports, the Databox Referrer report 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 as openai) and app referers such as android-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 calling parent::get() (Blustore, Edructer, Flioukas, Nautilus, OptikaLiolios, Smile) should replace their array_unique line with $this->normalizeProductIds($productIds); they still get the buildSql() 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 raw implode (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() or CartResource::getGifts(), so those fixes reach every fork automatically. The new protected method normalizeProductIds($productIds): array is additive.
  • [4.126.0] REQUIRES php migrator.php migrate:
    • 20261006120000_add_url_lang_index_to_shop_product_mui.php — first trims leading/trailing / from legacy shop_product_mui.url values (chunked by primary key), then adds INDEX url_lang (url(191), lang) using online DDL (ALGORITHM=INPLACE, LOCK=NONE, plain ALTER fallback). Skipped when url_lang or any index leading with url already 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 the findSlugsByUrl() lookup commented out as a temporary fix (e.g. Evripidis, 8a9277534 in application/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.url themselves (custom importers or an override of Product\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 url keeps 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}. Show name/address to prefill the invoice form only on valid; on unverified let the customer continue and say the number could not be checked; a 429 (with Retry-After) means "treat as unverified". Persist the returned vatNumber (normalised), not the raw input. doy and profession are 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 on Advisable\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 counts REMOTE_ADDR, as the login throttle does. Behind a load balancer or CDN with proxy_ips empty, 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_CHECKER credentials are configured, because only AADE returns doy and profession. Every uncached AADE lookup notifies the looked-up business, which the cache and throttle limit. AADE never answers invalid, 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_invalid instead 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) and AdvVatValidate::validateGreekVat() (now delegates to GreekAfm::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/country is unchanged and still unfiltered; a headless country picker should intersect it with checkout.availableCountries when that list is non-empty.
  • [4.126.0] Security: the storefront social-login fallback customer/requestEmail signed the visitor in as a typed email address. It is removed. Google sign-in now requires Google's email_verified claim; 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 _remap route. A fork overriding it, or redirecting to customer/requestEmail, must drop that code
  • [4.126.0] Check for overrides: Adv_customer::oAuth2Login() — no longer redirects to customer/requestEmail; refuses through the new refuseSocialLogin() and accepts only verifiedSocialLoginEmail(), which refuses any resource owner other than GoogleUser / FacebookUser. A fork adding a provider must override verifiedSocialLoginEmail()
  • [4.126.0] Check for overrides: Adv_customer::googleLogin() / facebookLogin() — now 404 unless SOCIAL_AUTH.GOOGLE_LOGIN_ENABLED / FACEBOOK_LOGIN_ENABLED is on
  • [4.126.0] UI Update: customerRequestEmail layout removed from template.json / mainTemplate.json with its views (main/layouts/customer/request_email.php, default/layouts/library/customer/request_email.php and its empty _request_email.scss). Translation key customer.login.requestEmail replaced by customer.login.social.error, shown on the login page through the login_message flashdata