Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem: csv:digital-object-path-check wrongly complains about unused and missing files #1923

Open
miceno opened this issue Feb 11, 2025 · 0 comments · May be fixed by #1924
Open

Problem: csv:digital-object-path-check wrongly complains about unused and missing files #1923

miceno opened this issue Feb 11, 2025 · 0 comments · May be fixed by #1924
Labels
Type: bug A flaw in the code that causes the software to produce an incorrect or unexpected result.

Comments

@miceno
Copy link

miceno commented Feb 11, 2025

Current Behavior

Run the csv:digital-object-path-check from the CLI using the following data:

Content of image folder is:

[atom@public_html]$ tree /tmp/folderimage/
/tmp/folderimage/
├── dir1
│   └── file2.png
└── file1.png

1 directory, 2 files

Import CSV file is:

[atom@public_html]$ cat /tmp/images.csv 
filename
file1.png
dir1/file2.png
[atom@public_html]$ php74 -d memory_limit=-1 symfony csv:digital-object-path-check -n filename /tmp/folderimage /tmp/images.csv
>> digital-object-path-check Checking filename column.
Unused files:
* dir1/file2.png

Files referenced in CSV that are missing:
* file2.png

The command wrongly complains about unused files and missing files 😢

Expected Behavior

Run the csv:digital-object-path-check from the CLI using the following data:

Content of image folder is:

[atom@public_html]$ tree /tmp/folderimage/
/tmp/folderimage/
├── dir1
│   └── file2.png
└── file1.png

1 directory, 2 files

Import CSV file is:

[atom@public_html]$ cat /tmp/images.csv 
filename
file1.png
dir1/file2.png
[atom@public_html]$ php74 -d memory_limit=-1 symfony csv:digital-object-path-check -n filename /tmp/folderimage /tmp/images.csv
>> digital-object-path-check Checking filename column.

NO unused files nor message should appear.

Possible Solution

The problem is the way the list of images is obtained, since the code is performing a basename for each file!!!!!! This is really bad 👎

The solution is trivial, just removing the basename call will be enough... I am preparing a PR to solve it.

Context and Notes

I am afraid there is no testing code on this part of the code, since the change is there since 2022... Or people is not using this command at all.

Version used

AtoM 2.8.2

Operating System and version

No response

Default installation culture

en,ca,es

PHP version

PHP 7.4

Contact details

contact me at @miceno

@miceno miceno added the Type: bug A flaw in the code that causes the software to produce an incorrect or unexpected result. label Feb 11, 2025
@miceno miceno linked a pull request Feb 11, 2025 that will close this issue
@anvit anvit linked a pull request Feb 18, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: bug A flaw in the code that causes the software to produce an incorrect or unexpected result.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant