Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
W
WordPress
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 22
    • Issues 22
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Operations
    • Operations
    • Incidents
  • Analytics
    • Analytics
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • Development
  • WordPress
  • Issues
  • #18

Closed
Open
Opened Feb 13, 2019 by ayduns@aydunsDeveloper

wp-cli sometimes fails to find cms path

Initially reported as https://github.com/veda-consulting/uk.co.vedaconsulting.mosaico/issues/293 but on further investigation the url issue only occurs when mailings are invoked by wp-cli.

When wp-cli is called with the --path option but the current working directory is not within the CMS tree, CRM_Utils_System_WordPress::cmsRootPath() is unable to determine the CMS path resulting in the realpath($cmsPath) call in CRM_Utils_System_WordPress::getCiviSourceStorage() returning the current working directory and hence a bad value for the $config->userFrameworkBaseURL which is used when replacing trackable URL's in CRM_Mailing_BAO_TrackableURL::getTrackerURL()

A workaround is to hardcode in civicrm.settings.php:
$civicrm_setting['URL Preferences']['userFrameworkResourceURL'] = 'https://domain.tld/wp-content/plugins/civicrm/civicrm';

The fix is to save the --path setting so that CRM_Utils_System_WordPress::cmsRootPath() returns the right information.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: dev/wordpress#18