When a site lives in a sub-directory CM Document export misnames the file

Created on 15 March 2024, 8 months ago

Problem/Motivation

When the drupal site it setup with a base_url that is inside a subdirectory of the domain, a CM Document export will put the subdirectory in the file name. However the import command will not be looking for the subdirectory name, so it fails to find the file to import.

Steps to reproduce

Site with base url = https://example.com/mydrupal/
Export a CM Document
Notice the file name is `mydrupalzZzALIASzZzOFzZzPAGE.yml`
But when you import the page if you use:

  • drush content-model-documentation:import /mydrupal/ALIAS/OF/PAGE the import will create a new document because there are not aliases in Drupal that begin with `mydrupal` (the site's sub-directory)
  • drush content-model-documentation:import /ALIAS/OF/PAGE the import will not work at all because it can't find an import file by that name.

Temp Workaround

Edit the export filenames to remove the subdirectory and the first zZz (which is the equivalent of a / )

Proposed resolution

There are two choices here (I am not sure which is best yet, but I am leaning toward #2.)

  1. Detect the subdirectory and remove if from the export file name before export. - This would force the import runner to use the path not including the subdirectory in the import command, which may be a little confusing.
  2. Detect the subdirectory just before looking up the alias and remove it. - This would allow the full path of the destination CM Document to be used in the import command.

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Fixed

Version

1.0

Component

Content model document

Created by

πŸ‡ΊπŸ‡ΈUnited States swirt Florida

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024