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.127.md for this page in Markdown format</div>

Home | Changelog

Version 4 ​

version 4.127 ​

  • [4.127.0] fix(migrations): fail pull requests that add two migrations with the same version, instead of failing at deploy (#920). A migration's version is the leading digits of its filename, and Phinx aborts both migrate and status when two files share one, so init_migrate.php exited non-zero at deploy and the database was never provisioned. Upstream and client forks create migrations independently (often with round-hour timestamps), so an upstream merge into a fork could bring in such a clash and nobody noticed before deploy. A new script, .docker/scripts/ci/check-migration-versions.sh, now runs on every pull request in both pipelines (Bitbucket "Migration Version Gate", GitHub migration-version-gate), lists every shared version with all its files, and exits non-zero. The resolution rule (upstream keeps its version, the fork renumbers its own migration and fixes the log row of databases where it already ran) is documented in docs/guides/Migrations.md, section "Version collisions (client forks)".
  • [4.127.0] feat(rest/checkout): PayPal for headless clients (#916). paypaladvanced can be selected for external frontends. confirm-payment now captures the approved PayPal order and confirms only when its completed captures come to exactly the order total in the order currency. An approved order whose amount is not the order total is not captured (the buyer is not charged; the client sees confirmed: false) and is logged at error level, as are completed captures that do not match. A repeated call does not capture twice. PayPal shows the merchant's site_name instead of AdvEshop, for both PayPal adapters (an empty name is omitted, so PayPal shows the business name of the merchant's PayPal account). A payment confirmed at the gateway for an order that is no longer PENDING is logged at error level for a refund. PayPalRestApi sends explicit timeouts (connect 3 s, request 15 s) and authenticates on first use instead of in its constructor (#544). The incomplete-orders job no longer cancels a pending paypaladvanced order before 180 minutes (#555 item 4). REST 1.114.
  • [4.127.0] fix(checkout): CardLink payments from a headless client no longer overflow the bank's callback field (#915). The client returnUrl / cancelUrl from POST /rest/checkout/place-order were appended to the gateway callback as ?advReturnUrl= (#734), and CardLink (alpha, eurobank) sends that callback as confirmUrl / cancelUrl, capped by the bank at 128 characters, so a realistic client URL made the field over-long. Both URLs are now stored on the order (shop_order.client_return_url / client_cancel_url), the callbacks are the bare legacy routes again, and the callback arms read the stored URL for their leg (alpha / eurobank both legs, ethniki / ethniki_ee success). A valid CardLink callback for an order that is no longer PENDING (the bank's delayed background copy, or a repeated POST) now also redirects a REST customer there instead of showing the payment-inactive page. Storefront orders leave the columns NULL and render exactly as before. Customer erasure clears both columns. REST 1.113.
  • [4.127.0] feat(rest/checkout): GET /rest/checkout/payment-methods says how to present each payway (#732). Every entry gains kind (offline, bank_code, redirect, embedded, widget; open-ended) and redirectMethod (GET/POST for redirect, else null), so a headless client no longer needs its own payway table and can tell an unpaid paybybank order from a completed offline one. requiresRedirect stays, now derived from kind. Every registrable payway has an English label. REST API version 1.112.
  • [4.127.0] feat(notifications): push notifications for the mobile apps, for order updates and for marketing (#559). A new Advisable\Domains\Notification service registers app installs (signed in or not), stores consent per category (orders on by default; promos and news only after an express opt-in), queues one delivery per device and sends through FCM HTTP v1 after the response and from the new DispatchNotifications job (every minute), with retries, dead-token handling and a log row per customer in the message history (message_type PUSH). Every send is re-checked against the device as it is then: a withdrawn consent, or a device now signed in as someone else, skips it. Order pushes follow the order emails and SMS the customer already gets (Adv_mailer::order_complete / order_has_been_updated / order_is_on_store, sendSmsForOrder() and sendSmsForOrderId()), at most one per order per save. Settings → Customer notifications (now open to the Admin role) gains a push switch, a marketing daily cap, quiet hours, test customers, retention periods and a per-event table: customer email on/off, push mode (off / alongside email or SMS / instead of SMS for app users) and editable push texts with {serial} and {status}. A new ecommercen Plus → Marketing → Push notifications page lets the Marketing role compose, target (everyone who opted in, an Audience, one customer), schedule, test-send, send and cancel pushes and see sent / failed / opened counts. The daily PruneNotifications job deletes devices inactive for 90 days and delivery history older than 12 months (both editable), and deleting a customer account deletes their notification data. OneSignal is deprecated. REST API version 1.111. Nothing is sent until a shop enables push and the FCM_SERVICE_ACCOUNT_JSON secret is deployed.
  • [4.127.0] feat(rest/product): GET /rest/product/product (and /item) accepts filter[averageRatingGte] and filter[reviewCountGte], inclusive lower bounds on shop_product.average_rating / review_count, so a «4 stars and up» tier is one server-side request (#787). filter[averageRatingGte]=4 returns products rated 4.0, 4.5 and 5.0. The exact filter[averageRating] / filter[reviewCount] keys are unchanged. A non-numeric bound is ignored for that key only, like the #642 price bounds. The discount half of #787 is deliberately not added: the yes/no Omnibus filter[priceDrop] (REST 1.106) serves the discount facet, and a bound on the raw discount_percent column would disagree with the displayed discount inside a special window. REST API version 1.110.
  • [4.127.0] feat(rest/auth): refresh tokens rotate with reuse detection: POST /rest/auth/customer/refresh and /rest/auth/admin/refresh return a new refresh_token that lives a full refresh lifetime from the refresh, so a customer who keeps using the app stays signed in (Advisable-com/ecommercen#790)
  • [4.127.0] fix/perf(eshop): related products on the product page no longer run the category and vendor queries on every product view (#913). Adv_related_product_model::getRelatedProductsCategory() and getRelatedProductsVendor() now read through pscache (default L2 TTL, cleared by the admin "products" cache clear), keyed per category / per vendor, via new public uncached model methods categoryTopProducts() and vendorTopProducts(). They fetch limit+1 rows and drop the current product in PHP, so the cache key does not depend on the product. On Evripidis the uncached category query took 4.5 s on a 233k-product category; it now runs once per category per language per TTL instead of once per product view.
  • [4.127.0] fix(eshop): the category tier now filters shop_vendor_mui by language; multilingual shops could previously show vendor_name / vendor_slug in another language.
  • [4.127.0] Behaviour changes: a product hand-linked to itself is no longer shown in its own related list (Lp tier). With a null category id, the category tier now uses the product's most specific category (not the parent of another of its categories; lowest id on ties) instead of an arbitrary one.
  • [4.127.0] Hardening: fixWhere() now reads the escape flag from index 2 of a condition array (was index 1); product ids are cast to int in all four tiers (Lp, line, category, vendor).
  • [4.127.0] fix(eshop): Adv_product_model::get_mui_records() no longer always sorts with ORDER BY RAND(). The $random parameter defaults to false, but the check was !is_null($random), so every call sorted randomly and MySQL had to sort the whole matching set. The random order now applies only when a caller passes a truthy $random. No caller in main uses this method; behaviour only changes for callers that did not ask for a random order.
  • [4.127.0] perf(price-tracking): storefront product parser no longer builds the full price-drop timeline for every product on every render (#912). Adv_product_parser_model::get() built a day-by-day timeline per product on each parse; measured ~14 ms PHP per 40-product parse on a 1.71M-product catalogue (SQL ~1.2 ms), multiplied by 3-4 parses per request with a cart. New storefront-only methods GraphService::storefrontPricesBulk(array $productIds) and GraphService::storefrontPrices(int $productId) (and PriceDropVerdictCalculator::noClaimVerdict()) skip that work, and Adv_product_parser_model::setPriceTracking() now calls storefrontPrices(). The tail of PriceDropVerdictCalculator::parseResponse() was extracted into a new protected applyCurrentPrice(). Behaviour: with PRICE_TRACK.ENABLED off and all four graph settings off (ENABLED_GRAPH, ENABLED_ALL_GRAPH, ENABLED_GRAPH_PRODUCT_CARD, ENABLED_GRAPH_PRODUCT_PAGE), the parser makes no price-tracking DB calls and every product gets the empty verdict. With PRICE_TRACK.ENABLED on and no graph setting on, a product that cannot show a price-drop claim gets prices = [] instead of its timeline; referencePrice, saveValue, shouldDisplay and discountPass are unchanged. With any graph setting on, output is unchanged (full verdict, including prices), whatever PRICE_TRACK.ENABLED is. REST GET /rest/product/price-tracking/graph*, legacy /api/priceTracking/* and the TrackPrices job (PriceDropRefresher) are untouched and keep using productPricesBulk() / productPrices().
  • [4.127.0] fix(http): verify outbound TLS in development against the current CA store instead of the 2018 cacert.pem bundle (#908). Development only: in ENVIRONMENT=development integrations verified TLS against application/config/cacert.pem, a Mozilla bundle frozen at 2018-06-20, so services with newer roots failed locally with cURL error 60 (for example the VIES VAT lookup POST /rest/checkout/vat-number answered unverified). A new helper Advisable\Support\Http\TlsVerify::option() (backed by the new direct dependency composer/ca-bundle) returns the OS/PHP-configured CA store when present (for example openssl.cafile), otherwise the package's bundled Mozilla list, in development, and true otherwise. All 30 src/ Guzzle clients that set verify now call it (Apifon, Cloudflare, Domains/Tax VIES/AADE, Europharmacy, Manago, Marketdata, Moosend, Omni, OpenStreetMaps, PayByBank, Jcc, Klarna, PayPal, Public2P, Recaptcha, Advisable Services trait, Shopflix, Shopify, Skroutz, the Acs/Asap/BoxNow/DailyCourier/Dhl/GenikiV2/Qualco/Skroutz transporters, BunnyStream, VivaWallet, Yuboto). Staging and production behaviour is unchanged (verify => true). application/config/cacert.pem is kept and refreshed to the current Mozilla bundle (as of 2026-08-13) because some client forks read it directly; main no longer reads it.

Notes

  • [4.127.0] Client forks: after merging this release, the fork's PR pipelines run the gate. A collision already present in a fork will now fail its pull requests until the fork's migration is renumbered as described in docs/guides/Migrations.md. A fork with a customized bitbucket-pipelines.yml should keep the new "Migration Version Gate" step when resolving merge conflicts.
  • [4.127.0] The duplicate-migration-version gate (#920) needs no migration, REST contract change or config key.
  • [4.127.0] Check for overrides: PayPalAdapter::__construct() and PayPalExpressAdapter::__construct() now require $brandName. A fork that builds either adapter itself must pass it, for example config_item('site_name'). PayPalRestApi::__construct() gains optional $timeout, $connectTimeout and $client, and makes no network call, so a fork that relied on construction failing fast on bad credentials now sees the failure on the first call (logged, same return values).
  • [4.127.0] Storefront PayPal Advanced: its abandoned orders are now cancelled after 180 minutes instead of on the next 5-minute run, and only when PayPal answers that nothing was captured: a failed PayPal read or a capture PayPal holds for review no longer cancels the order, it is checked again on the next run. An order PayPal answers 404 for (unknown on the configured account) is still cancelled. A completed capture on an order still pending after the 180 minutes is logged at error level on every run, for a manual decision or a refund. The legacy paypal (NVP) payway is unchanged.
  • [4.127.0] REQUIRES php migrator.php migrate:
    • 20261010120000_add_client_return_urls_to_shop_order.php — two nullable TEXT columns on shop_order (#915).
    • 20261009120000_create_notification_tables.php — six notification_* tables (#559).
  • [4.127.0] Check for overrides: a fork that overrides PaymentCallbackUrlBuilder::confirmationUrl() / failureUrl() and appends a client URL itself, or overrides Adv_checkout::redirectToClientReturnUrl() (now (object $order, bool $succeeded)), must follow the new shape; PaymentCallbackUrlBuilder::CLIENT_RETURN_URL_PARAM is removed.
  • [4.127.0] Deploy window: an order placed before the deploy whose gateway callback arrives after it renders this deployment's page instead of redirecting to the client; it is settled normally.
  • [4.127.0] Check for overrides: Advisable\Domains\Checkout\Payment\PaymentAdapterInterface::supportsRedirect() is replaced by presentation(): PaymentPresentation. A Custom\ payment adapter in a fork is a load-time fatal until it implements presentation(); return the presentation its initializePayment() actually produces (for example PaymentPresentation::redirect(PaymentPresentation::METHOD_POST) when it builds a POST PaymentRedirect).
  • [4.127.0] Throttle: device registration and consent saves (rest/notification/devices, rest/notification/preferences) are limited per device and per IP (REST_NOTIFICATION_THROTTLE_* in .env.example: 20 per device, 120 per IP per 10 minutes) and answer 429 with Retry-After beyond that.
  • [4.127.0] Secret: set FCM_SERVICE_ACCOUNT_JSON to the JSON key of a service account that holds only the Firebase Cloud Messaging API Admin role in the shop's app project (Google Cloud console → IAM & Admin → Service accounts), not the Firebase Admin SDK account, which reaches every Firebase product. A deployment secret, never the registry: it can push to every device of the app. The DI container reads it when it is compiled, so rebuild the container (delete cache/container.php) after setting or changing it.
  • [4.127.0] Check for overrides — jobs: forks with their own application/config/jobs.php must add the notifications group with DispatchNotifications (every minute) and PruneNotifications (daily), and their getOptions() lines, or queued pushes are only sent right after the request that queued them and nothing is ever pruned.
  • [4.127.0] Check for overrides — REST routes: forks with their own rest_routes.php must add the ten rest/notification/* routes (and their (\w{2})/ twins).
  • [4.127.0] Check for overrides — mailer and SMS: a fork overriding Adv_mailer::order_complete(), order_has_been_updated() or order_is_on_store() must wrap its customer email in $this->orderEmailEnabled(...) and call $this->notifyOrderEvent(...); a fork overriding sendSmsForOrder() or sendSmsForOrderId() must call OrderNotifier::replacesSms() before sending and orderEvent() after (orderNotifierOrNull() in shopmodule_helper.php fetches it), as the upstream functions now do. These forks define their own sendSmsForOrder() in application/helpers/shopmodule_helper.php, which wins over upstream's through the function_exists guard, so they skip the push hook silently and no merge conflict shows it (Bitbucket code search, 2026-10-13): v4-wecare, v4-inatural, v4-smilepharmacy, v4-heals, v4-pharmado, v4-central, v4-pharm16, v4-pharmacy-discount, v4-optika-liolios, v4-anatomicline. Port the hook into each before enabling push for that shop.
  • [4.127.0] Check for overrides — REST policies: application/config/rest_policies.php gains a guest (auth: guest) entry for Notification::class. The global default is auth: backend, so a fork whose copy diverges from upstream and lacks the entry answers every app call to rest/notification/* with 401; add it by hand. A copy identical to upstream gets it from the 3-way merge.
  • [4.127.0] Check for overrides — admin routes and menu: forks whose application/config/routes.php or application/config/admin_menu.php diverge from upstream must add the push_notifications_admin routes and the ecommercen Plus → Marketing → Push notifications menu entry by hand.
  • [4.127.0] Check for overrides — account deletion: CustomerErasure gains NotificationRecordsStep; a fork that registers its own step list in the container must add it.
  • [4.127.0] UI Update: application/views/admin/settings/notification_settings.php gains the push panel (switch, daily cap, quiet hours, test customers, retention), the per-event table and a deprecation note on the OneSignal fields, and Adv_settings::notification_settings() saves them; a fork overriding that view or Adv_settings must merge both, or the controls are missing. The page's menu entry now includes the Admin role.
  • [4.127.0] Behaviour on merge: none until push is enabled, except that PruneNotifications and account deletion act on the (empty) new tables. Every order email stays on by default; the email switches only change something once an admin turns one off.
  • [4.127.0] Deprecated: the ONE_SIGNAL settings (enable, app id, Safari web id). App push goes through FCM; the fields are removed in a later release.
  • [4.127.0] shop_customer_message_history.message_type gains the value PUSH (MessageChannel::PUSH).
  • [4.127.0] No migration, no schema change, no response-field change. Purely additive filter keys on the modern Product domain; no legacy file touched, so no fork override is affected.
  • [4.127.0] UI Update: REST contract note 1.115 (rotation). POST /rest/auth/customer/refresh (and /admin/refresh) now answers 200 { "access_token", "refresh_token" }. A client MUST store the refresh_token from every refresh response and use it for the next refresh and for logout; the one it sent is superseded. A client that keeps its first token still works for the grace window (JWT_REFRESH_TOKEN_GRACE, 60 s): the old token then returns the current one. After that, presenting the old token is treated as theft: every refresh token of the user is deleted and the answer is 401, so the customer signs in again. A lost response is safe to retry with the same token within the window. A retry with the old token AFTER the grace window (for example a client that was offline when the response was lost) counts as reuse and signs the customer out; product has accepted this for the standard 60 s window. Treat 401 from refresh as signed out. For the WeCare app: the Tauri auth_refresh command and server/api/auth/refresh.post.ts must persist the returned token before this is deployed.
  • [4.127.0] Behaviour change: the refresh lifetime now slides (JWT_REFRESH_TOKEN_EXPIRY counted from the latest refresh, 7 days by default), so an active customer is no longer signed out 7 days after login. A customer still has one REST session: a new login replaces it. Logout, a password reset and a storefront password change end the whole session, whichever of its tokens is presented. The migration 20261001120000_add_rotation_columns_to_refresh_tokens adds rotated_at, replaced_by and an index on token; run it before deploying (existing tokens stay valid). New optional env JWT_REFRESH_TOKEN_GRACE (seconds, 0..3600, default 60); 0 turns the grace window off, so a superseded token is always treated as reuse.
  • [4.127.0] Check for overrides: Advisable\Rest\Auth\Tokens gained rotateRefreshToken(); RefreshTokenModel gained rotate() and revoke() now deletes every row of the token's user and type. Advisable\Rest\Auth\Config has a new last constructor argument refreshGraceSeconds (default 60); a fork that builds Config itself or aliases the service needs the rest.auth.refresh_grace parameter. A fork that overrides CustomerAuth::refresh() or AdminAuth::refresh() must call rotateRefreshToken() and return its refresh_token, otherwise its clients are signed out when the grace window ends. A fork that owns refresh_tokens queries (reports, cleanup) will now see several rows per customer; the current one has rotated_at NULL.
  • [4.127.0] Not in scope: hashing refresh tokens at rest and multi-device sessions are follow-ups on #790.
  • [4.127.0] Check for overrides: forks overriding getRelatedProductsCategory() or getRelatedProductsVendor() in Related_product_model bypass the new cache (Evripidis today, commit ae5fc6784; review whether its override can be dropped).
  • [4.127.0] Check for overrides: forks overriding fixWhere() should take the index-2 escape fix.
  • [4.127.0] Check for overrides: forks overriding getRelatedProductsLp() (Heals, Nautilus) do not get the new self-exclusion guard or the (int) cast on the product id; both still interpolate {$productId} raw into their SQL.
  • [4.127.0] Random order is now cached: if a shop sets registry OTHER.RELATED_PRODUCTS_ORDER to a random order (e.g. RAND()), the order is cached. It stays the same for the cache lifetime (default L2 TTL, 86400 s) and is shared by every product in the same category / vendor. Clear the products cache to reshuffle.
  • [4.127.0] Stock and active changes lag: the cached list applies the stock (product_codes.stock > 0 OR negative_stock = 1), price > 0 and active filters when it is built. A product that sells out or is deactivated can stay in a related list until the entry expires or the products cache is cleared. Price and stock shown on each card are still loaded fresh.
  • [4.127.0] No DB migration, no config key.
  • [4.127.0] Check for overrides: Megastore's SyncCategoryArabatzis job (application/modules/job/libraries/SyncCategoryArabatzis.php) is the only known fork caller; it reads the full set and ignores the order, so it simply stops paying for the random sort. A fork that relied on the accidental random order must now pass random: true.
  • [4.127.0] The get_mui_records() random-order fix needs no migration, REST contract change or config key.
  • [4.127.0] Check for overrides: Blustore, Edructer, Flioukas, Nautilus, OptikaLiolios and Smile override Product_parser_model::get() and call $this->setPriceTracking($product) per product. None override setPriceTracking(), so they get the fast path automatically on their next upstream merge (still one call per product; a per-fork switch to storefrontPricesBulk() would batch it).
  • [4.127.0] Check for overrides: a fork view that reads priceTracking['shouldDisplay'] or ['prices'] under a graph setting without PRICE_TRACK.ENABLED (e.g. ThePharmacist's product page, under ENABLED_GRAPH_PRODUCT_PAGE) keeps working: any graph setting keeps the full verdict.
  • [4.127.0] Check for overrides: a fork that overrides get() and calls productPricesBulk() directly stays on the full path; switch it to storefrontPricesBulk().
  • [4.127.0] Check for overrides: a fork that overrides PriceDropVerdictCalculator::parseResponse() or customises the verdict() rules must check applyCurrentPrice() and noClaimVerdict() (which hard-codes "the newest tracked price is the reference" for products that cannot qualify). As of this change no fork subclasses GraphService or PriceDropVerdictCalculator.
  • [4.127.0] The price-tracking storefront fast path (#912) needs no migration or REST contract change and changes no existing public signature.
  • [4.127.0] REQUIRES composer install: new direct dependency composer/ca-bundle (^1.5, locked 1.5.14).
  • [4.127.0] Check for overrides: forks with their own code that sets Guzzle verify to APPPATH . 'config/cacert.pem' should switch to \Advisable\Support\Http\TlsVerify::option(). Known instances: AdvisableSite and Anatomicline (application/modules/eshop/libraries/Acs.php), Services (application/libraries/Everhour.php, application/modules/api/controllers/Api_services_customer_aggregate.php), Smile (custom/Ai/Bedrock/ClientOptions.php). They keep working in the meantime thanks to the refreshed cacert.pem.
  • [4.127.0] Upstream merge, cacert.pem conflict: Services carries its own modified application/config/cacert.pem, so the merge conflicts on it. Take upstream's version (the 2026-08-13 Mozilla bundle). Other forks either match the base file or don't track it, and merge cleanly.
  • [4.127.0] Upstream merge, composer.lock conflict: every fork has its own composer.json/composer.lock without composer/ca-bundle. Resolve the conflict by re-running composer update composer/ca-bundle (rather than hand-merging the lock). A fork that takes the src/ change without the dependency fails with "class CaBundle not found" in development.
  • [4.127.0] The dev CA bundle change (#908) needs no migration, REST contract change or config key; only the composer install above.