Repository navigation
Fix for parameter "%n" on shared folders - #64
Conversation
| } catch (InvalidPathException $e) { | ||
| } catch (NotFoundException $e) { | ||
| } | ||
| $config = new Config('config/'); |
There was a problem hiding this comment.
this should come from \OCP\IConfig (method getSystemValue) and ought to be injected in the constructor.
There was a problem hiding this comment.
Should be resolved. Can you check it?
| $config = new Config('config/'); | ||
| $base_path = $config->getValue('datadirectory'); | ||
|
|
||
| $path = Filesystem::getLocalFile(Filesystem::getPath($nodeID)); |
There was a problem hiding this comment.
$nodeID is not necessarily set, since the exceptions are suppressed and not handled further
There was a problem hiding this comment.
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?
|
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! |
blizzz
left a comment
There was a problem hiding this comment.
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