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

FIX #24201 upload of external module fails to copy from incorrectly generated temp source dir #24340

Merged
merged 2 commits into from Mar 28, 2023

Conversation

simnandez
Copy link
Member

No description provided.

dol_syslog("We copy now directory ".$submodulenamedir." into target dir ".$dirins.'/'.$modulenameval);
$result = dolCopyDir($submodulenamedir, $dirins.'/'.$modulenameval, '0444', 1);
dol_syslog("We copy now directory ".$modulenamedir." into target dir ".$dirins.'/'.$modulenameval);
$result = dolCopyDir($modulenamedir, $dirins.'/'.$modulenameval, '0444', 1);
Copy link
Member

@eldy eldy Mar 26, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are in a loop that process $modulenameval (to be able to manage metapackages)
foreach ($modulenamearrays as $modulenameval) {
If you use $modulenamedir, you always copy the same dir.
If metapackage.conf contains
a
b
c
we must copy dir a into a , then b into b, then c into c.
With your change, source always has value a
It may solve for simple package but break for metapackage.

I think good solution is tho change the line
$submodulenamedir = $conf->admin->dir_temp.'/'.$tmpdir.'/htdocs/'.$modulenameval;

into

$submodulenamedir = $conf->admin->dir_temp.'/'.$tmpdir.'/'.$modulenameval;
if (!dol_is_dir($modulenamedir)) {
			$submodulenamedir = $conf->admin->dir_temp.'/'.$tmpdir.'/htdocs/'.$modulenameval;
}

Does this work for you ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right, I did not take into account the metapackages, the change has been made and tested.

@eldy eldy added the Discussion Some questions or discussions are opened and wait answers of author or other people to be processed label Mar 26, 2023
@eldy eldy merged commit 292385a into Dolibarr:17.0 Mar 28, 2023
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Discussion Some questions or discussions are opened and wait answers of author or other people to be processed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants