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 delete file from task tab #32756

Closed
wants to merge 1 commit into from

Conversation

rycks
Copy link
Contributor

@rycks rycks commented Jan 22, 2025

On task tab there is the list of linked files:

image

the trash icon have that sort of url

/projet/tasks/task.php?id=1&action=remove_file&token=xxx&file=PJ2211-0001%2FTK2211-0001%2FTK2211-0001_tache_modele-02.odt&entity=1

then the source code will sanitize file name and replace %2 with underscore and the consequence is delete can't be done but the success message is displayed !

image

this PR will fix that bug

@hregis
Copy link
Contributor

hregis commented Jan 22, 2025

@rycks je crois que c'est surtout un soucis de méthode qu'il faudrait uniformiser !!!

la méthode qu'il faut bannir et qui ne fonctionne pas :

task.php?id=1&action=remove_file&token=224235848ec31a65396934c32e8dc774&file=PJ2501-0001%2FTK2501-0001%2FTK2501-0001-Facture_FR68456030.pdf&entity=1

et l'appel qu'il faut utiliser :

document.php?action=deletefile&token=224235848ec31a65396934c32e8dc774&urlfile=PJ2501-0001%2FTK2501-0001%2FTK2501-0001-Facture_FR68456030.pdf&id=1&file=PJ2501-0001%2FTK2501-0001

@hregis
Copy link
Contributor

hregis commented Jan 22, 2025

@rycks il faut appeler "document.php" et virer "task.php" ici

@hregis hregis closed this Jan 22, 2025
@rycks
Copy link
Contributor Author

rycks commented Jan 22, 2025

@hregis hum ? why did you close that PR ?

@rycks rycks reopened this Jan 22, 2025
@hregis
Copy link
Contributor

hregis commented Jan 22, 2025

@rycks à force de mettre des pansements sur des jambes de bois on rajoute des effets de bords... regarde le lien qui fonctionne et fait en sorte d'avoir le même lien !

@rycks
Copy link
Contributor Author

rycks commented Jan 22, 2025

ok then maybe i have to do a better fix, you don't have to CLOSE that PR ... just tell me "please do like that" ... with such close before answer you send a bad message to people who just want to contribute !

@hregis
Copy link
Contributor

hregis commented Jan 22, 2025

@rycks désolé parfois je suis abrupte mais il y a des évidences qui me paraissent évidentes 😄

@hregis
Copy link
Contributor

hregis commented Jan 22, 2025

@rycks je te kiss la molaire ! 💋

@hregis
Copy link
Contributor

hregis commented Jan 22, 2025

@rycks le grand bleu ?

@hregis
Copy link
Contributor

hregis commented Jan 22, 2025

@rycks alors je rembobine... Monsieur Eric auriez-vous l'obligeance de faire en sorte que le lien de la poubelle qui ne fonctionne pas soit le même que celui qui fonctionne avant que "ça me casse les couilles" !! 😄 😄
C'est mieux ?

@rycks
Copy link
Contributor Author

rycks commented Jan 22, 2025

@hregis c'est pas tant la manière de le qui compte mais c'est le fait de cloturer la pr sans laisser la possibilité au contributeur de réagir qui est "de trop" ...

@rycks
Copy link
Contributor Author

rycks commented Jan 22, 2025

and about your suggestion to change from remove_file to document.php?action=deletefile that's a PR on 18.0 branch ... are you sure we have to do such code update ?

@hregis
Copy link
Contributor

hregis commented Jan 22, 2025

@rycks tu as raison et je m'en excuse... vieux ! Dolibarrien ! 💋
et sinon tu as compris ce que j'ai voulu dire ?

@hregis
Copy link
Contributor

hregis commented Jan 22, 2025

and about your suggestion to change from remove_file to document.php?action=deletefile that's a PR on 18.0 branch ... are you sure we have to do such code update ?

il faut demander au grand maître ! @eldy ? C'est bloquant donc on peut modifier ?

@hregis
Copy link
Contributor

hregis commented Jan 22, 2025

@rycks à mon avis l'appel à task.php au lieu de document.php pour supprimer un fichier devait être historique et n'a jamais été modifié !

@hregis
Copy link
Contributor

hregis commented Jan 22, 2025

@rycks tu vois de quoi je parle au niveau de l'histoire hein ? vieux développeur ! 😄

@rycks
Copy link
Contributor Author

rycks commented Jan 22, 2025

@hregis oeuf corse entre vieux codeurs !

@lvessiller-opendsi lvessiller-opendsi self-requested a review January 23, 2025 08:38
@lvessiller-opendsi
Copy link
Contributor

lvessiller-opendsi commented Jan 23, 2025

@eldy
It's a fix and this problem is still here in develop

//in case of a task filename is like PJ2211-0001%2FTK2211-0001%2FTK2211-0001_task.odt
//then dol_sanitizeFileName will convert it to PJ2211-0001_FTK2211-0001_FTK2211-0001_task.odt
//and that file does not exists so can't be deleted
$sanitizedFileName = dol_sanitizeFileName(GETPOST('file'));
Copy link
Member

Choose a reason for hiding this comment

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

This fix is very suspicious. If we have to manipulate the parameter fil to get the correct path of file, the problem is probably in the link where parameter file is wrong.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

of course but tasts are a the only case where files are in a subdirectory ... so please let me know what kind of parameter we could make to do it better ?

.../...file=PJ2211-0001/FTK2211-0001/FTK2211-0001_task.odt.../...

must be replaced by what ?

@eldy eldy added the Discussion Some questions or discussions are opened and wait answers of author or other people to be processed label Jan 26, 2025
@hregis
Copy link
Contributor

hregis commented Jan 27, 2025

@rycks @eldy enjoy and have a good day : #32807

@eldy eldy added PR to fix - See feedback in comments PR needs to be fixed to be integrated (some comments should describes the fix to do) and removed Discussion Some questions or discussions are opened and wait answers of author or other people to be processed labels Jan 27, 2025
@eldy
Copy link
Member

eldy commented Jan 27, 2025

So fix in v18 could be done the sameway it was done in v20.

@hregis
Copy link
Contributor

hregis commented Jan 27, 2025

sorry I didn't see that it was for branch 18

@hregis
Copy link
Contributor

hregis commented Jan 27, 2025

@rycks @eldy it's a good day : #32811

@hregis
Copy link
Contributor

hregis commented Jan 27, 2025

@rycks tu doutes de mes pouvoirs petit scarabée ?! 😄

@eldy eldy closed this Jan 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR to fix - See feedback in comments PR needs to be fixed to be integrated (some comments should describes the fix to do)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants