-
Notifications
You must be signed in to change notification settings - Fork 18
Fix for parameter "%n" on shared folders #64
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
Conversation
lib/Operation.php
Outdated
} catch (InvalidPathException $e) { | ||
} catch (NotFoundException $e) { | ||
} | ||
$config = new Config('config/'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should come from \OCP\IConfig (method getSystemValue
) and ought to be injected in the constructor.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be resolved. Can you check it?
lib/Operation.php
Outdated
$config = new Config('config/'); | ||
$base_path = $config->getValue('datadirectory'); | ||
|
||
$path = Filesystem::getLocalFile(Filesystem::getPath($nodeID)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$nodeID is not necessarily set, since the exceptions are suppressed and not handled further
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, what are the cases where $nodeID is not set and what is the best way to handle the exception? Should we fallback to the old solution (and have a possibly wrong file path on shared folders), or leave the %n path empty?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will try it myself this week and we'll see how it goes. I have to note that I have basically not much experience in php and the nextcloud environment, so please be gentle with me ;) |
Sure thing. Thanks for your contribution in the first place. Don't hesitate to ask if you're reaching dead ends. We're here to help. |
I can also confirm that creating and renaming files in group folders works and triggers a workflow_script Steps
The path _groupfolders/1/sample.pdf exists in nextclouds data folder! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good and does what is advertized :)
I added another commit fixing whitespaces – we use tabs not spaces
@k1l1 one last thing: would you sign off your commits? https://github.com/nextcloud/workflow_script/pull/64/checks?check_run_id=1447292190 |
and apologies for my late reaction, the notification drowned among others :( |
Fix to allow '%n' parameter to give out real relative file path in shared folder scenario. Signed-off-by: Kilian Pfeiffer <k.pfeiffer@pfffer.eu>
Signed-off-by: Kilian Pfeiffer <k.pfeiffer@pfffer.eu>
Signed-off-by: Kilian Pfeiffer <k.pfeiffer@pfffer.eu>
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de> Signed-off-by: Kilian Pfeiffer <k.pfeiffer@pfffer.eu>
45c2ac4
to
ba30955
Compare
merged! |
/backport to stable20 |
/backport to stable19 |
/backport to stable18 |
@blizzz When do you plan to relase this fix? |
@jakobroehrl release is out, thanks for your patience: https://github.com/nextcloud/workflow_script/releases/tag/v1.3.3 |
Thanks for the information. |
Fix to allow '%n' parameter to give out real relative file path in shared folder scenario.
Addressing issues: #48 and possibly #38
Scenario
User A creates Folder /myfolder at shares it with User B
User B moves Folder from root dir to /subfolder/myfolder
User B creates file /subfolder/myfolder/file1 in this folder which triggers a workflow script:
Result before:
user-id (%o): A
nextcloud-relative path (%n): B/files/subfolder/myfolder/file1 <---- file does not exists on drive at this position
Result after:
user-id (%o): A
nextcloud-relative path (%n): B/files/myfolder/file1 <---- file exists