Skip to content

Add option to get resource perspective without creating directory.#4659

Open
beeyayjay wants to merge 4 commits into
2.xfrom
resource_dirs
Open

Add option to get resource perspective without creating directory.#4659
beeyayjay wants to merge 4 commits into
2.xfrom
resource_dirs

Conversation

@beeyayjay
Copy link
Copy Markdown
Contributor

Fixes [issue#]
27408

When the DKAN Resource setting, "Delete local resource", is enabled, the local resouce directories are deleted after a harvest run, but are recreated after harvest revert. This leaves unused and useless directories in the filesystem.

Describe your changes

Added an optional parameter to ResourceLocalizer::get(), so that calling functions can skip the code that recreates the directory

QA Steps

  • View resources directory ( ls -l web/sites/default/files/resources) and note the total number of items.
  • Go to /admin/dkan/resources, check "Delete local resource", and save.
  • Run harvest (e.g. ddev drush dkan:harvest:run sample_content, then run cron a couple of times
  • Run ls -l web/sites/default/files/resources and confirm the total hasn't changed
  • Revert harvest (e.g. ddev drush dkan:harvest:revert sample_content, the nrun cron
  • Run ls -l web/sites/default/files/resources and confirm the total still hasn't changed

Checklist before requesting review

If any of these are left unchecked, please provide an explanation
Bug fix

  • I have updated or added tests to cover my code
  • I have updated or added documentation

@janette
Copy link
Copy Markdown
Member

janette commented Feb 17, 2026

@beeyayjay this looks good, could you include an update to the label and info for the "Delete local copy" configuration screen in this PR?

@janette
Copy link
Copy Markdown
Member

janette commented Feb 17, 2026

@beeyayjay I pushed a commit with my suggested verbage, please review it and confirm it makes sense.
Screenshot 2026-02-17 at 1 58 02 PM

@janette
Copy link
Copy Markdown
Member

janette commented Feb 18, 2026

Hold to merge into 4.x release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants