JUST IN CASE:

In case of possible incompatibility between the uploadpath_20071108_patch and an upload.module overriding module such as image_cache, here is a patch suggestion for per-nodetype uploadpath redirection without uploadpath's default setting:

Eventhough this uploadpath.module PATCHED works with the image.module ( http://drupal.org/node/152089#comment-631586 ) , other modules such as image_cache, which creates folders within the files/images folder (and thus overrides the upload module) may need a feature that would allow to choose the nodetypes we'd like uploadpath to redirect OR NOT (i.e. without a default setting). If someone come accross some incompatibility, please report them here or in an other topic linked here.

The eventual turnaround could be done for example by:
- disabling uploadpath's default redirection by entering a within the nodetype uploadpath field within the admin/settings/uploadpath page. (seems to be the easiest way)
- or by adding a checkbox fieldset within the admin/settings/uploadpath page that would first allow to enable/disable uplaodpath redirection per nodetypes. (Eventually, the option could be found within the nodetype's config page, but that's messy).

What do you think?

Comments

davidwhthomas’s picture

Status: Postponed (maintainer needs more info) » Needs review
StatusFileSize
new6.2 KB
new5.75 KB

My thoughts exactly.

I thought perhaps there is a possibility to weight the modules so they process together correctly (i.e imagecache and uploadpath etc...)

However, I think a patch to uploadpath that allows the admin to set node types for uploadpath to exclude - is a good idea.

This patch allows :

1) Set the node types to exclude from upload path
2) Check in node_api that the type is not in the excluded set prior to processing
3) date token bugfix as optional config setting.

Patch is attached.

regards,

DT

P.S I'll include the patched .module file also, for those who like it like that.

doc2@drupalfr.org’s picture

Wow, good job!

(Just a suggestion: Should the topic title be changed for something like "Patch for switching per-nodetype uploadpath defaults on/off"..?)

I'll let you know when I come accross problems once I'll have it installed.

Thank you!

davidwhthomas’s picture

StatusFileSize
new6.22 KB

Nice one, glad you like it :-)

I'll attach this one more patch.

It changes:

variable_get('uploadpath_excluded_node_types', 0)

to

variable_get('uploadpath_excluded_node_types', array())

where the default value is the correct data type.

That should do it :-)

DT

P.S I updated the attached patch with one last array() change.

doc2@drupalfr.org’s picture

Thanx again, these new features are just great! And Happy New Year!

I'm back in the game! I patched the original uploadpath.module with the 20071213b.patch. I just checked the admin/settings/uploadpath page so far. (NB I still use drupal 5.3 lacking time for upgrading)

I noticed that your collapsible fielsets are not collapsible anymore once they are opened. This is just a minor "by design" bug and I would not like you to loose your time fixing it if the rest of the dev works... which I don't know yet. I'll keep you posted anyways.

Best wishes for you and the drupal community!

doc2@drupalfr.org’s picture

OUPS, my mistake sorry. This collapsing error is a general error on my drupal site.

Do not care about my previous post.

messenger’s picture

did this patch get committed?
Edit -- looks like not. I patched against the uploadpath 5.x-dev dated may 5 2008 and got a #4 hunk failed. I manually applied the failed bit, but I am not seeing any difference in the file upload path setting page.
Could you reroll the patch against the current dev?
I think this is a great module, it's nice to have some consistency and readability between the webface and the file organization.

Does this module conflict with the core upload module and the imagecache module? I'm trying to sort that out, in case that is my problem for why I cannot get the upload paths to be used.
thanks

ar-jan’s picture

StatusFileSize
new5.56 KB

This patch for 6.x: I'm working on a D6 site and want to use the features of this patch there. I used the patch posted in #237613: Port upload path to 6.x for a working 6.x UploadPath module (see http://drupal.org/node/237613#comment-893907 for patch against 2008-May-05 release).
Next I got this thread's patch working on the 6.x-patched UploadPath by adding & replacing above 20071213b patch's code into it, with minimal changes to any code. However I'm not a coder and I have little understanding how exactly the Module works, so I'm sure this code should be checked by someone. That said, so far everything works on my test site.

So here's the patch to apply 20071213b to the 6.x-patched module.

davidwhthomas’s picture

Status: Needs review » Closed (fixed)