Skip to content

2.1.0-pl

Latest

Choose a tag to compare

@Ibochkarev Ibochkarev released this 27 Jul 05:03
5e11bcc

[2.1.0-pl]

Added

  • Service API: resolveDevice(), getDeviceType(), isMobile(), isTablet(), isDesktop().
  • Fenom modifier |mobiledetect for conditional output ({if 'mobile' | mobiledetect}).
  • Example chunk tplMobileDetectSwitch with links to force desktop, tablet, mobile or auto-detect mode.

Changed

  • Updated mobiledetect/mobiledetectlib to 4.11.x (Detection\MobileDetect).
  • Explicit MODX Revolution 2.8+ and MODX 3.x support; transport build uses PSR-4 bootstrap for modPackageBuilder on MODX 3.
  • Fixed Fenom block functions ({mobile}, {phone}, {tablet}, {desktop}, {standard}) returning empty string instead of implicit null.
  • Fixed repeated Fenom registration on pdoToolsOnFenomInit (memory exhaustion on large Fenom templates).
  • Fenom init guard uses getTag('mobile') instead of getModifier('mobiledetect'): pdoTools autoloads unknown modifiers as snippets, so the old check skipped block registration.
  • Plugin is packaged as non-static (static = 0): a static plugin with a media source caused memory exhaustion while Fenom was still initializing.
  • Wrapped mobiledetectPluginService() in function_exists() so the plugin can run on both pdoToolsOnFenomInit and OnWebPagePrerender in one request.
  • Skip cookie writes in CLI and after headers are sent (canPersistCookie()).
  • Fixed potential infinite recursion in parseDocument() when saved cookie mode equals the current pass.

Fixed

  • System setting md_disable_plugin default aligned with transport settings: plugin is enabled by default (false).
  • md_tablet_is_standard now remaps tablet → standard for snippet, Fenom blocks/modifier and service API (resolveDevice, isDesktop, isTablet), not only HTML tags.

Breaking Changes

  • Requires PHP 8.2+ (mobiledetectlib 4.11.x).
  • Internal detector class changed from \Mobile_Detect to Detection\MobileDetect. Custom code that called getDetector() and relied on the legacy class must update imports and API usage.

Dependencies

  • mobiledetect/mobiledetectlib ^4.11
  • psr/simple-cache ^1.0 || ^2.0 || ^3.0

New Contributors

Full Changelog: https://github.com/modx-pro/MobileDetect/commits/2.1.0-pl