Bruno17 / MIGX

MIGX for revo 2.2 and above
83 stars 78 forks source link

migxresourcemediapath: createpath always false if docid is given as a parameter #342

Open pepebe opened 5 years ago

pepebe commented 5 years ago

As I read this, $createpath is always false if it is added as a parameter to migxresourcemediapath.

It starts as false (line 29)

$createpath = false;

later it may get a different value:

$createpath = $createfolder (line 55)

BUT only if docid is empty (line 47)

if (empty($docid)) {}

https://github.com/Bruno17/MIGX/blob/master/core/components/migx/elements/snippets/migxresourcemediapath.snippet.php

As a result line 119 will never create a new folder if docid was given as a parameter to the script:

if ($createpath && !file_exists($fullpath)) {...}

Is this intended?

Cheers,

pepebe