Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Just filing a request to upgrade to 5.x ... I know the description for the module suggests that there are no plans to upgrade, but I'm hoping the maintainer will revisit this.
Comment | File | Size | Author |
---|---|---|---|
#13 | attachment_4.7_to_5.1_0.patch | 13.33 KB | cscsteve |
#10 | attachment_4.7_to_5.1.patch | 12.42 KB | cscsteve |
#7 | attachment.module_0.txt | 8.8 KB | jonfhancock |
#6 | attachment.module.txt | 16.19 KB | jonfhancock |
Comments
Comment #1
drewish CreditAttribution: drewish commentedif people want to provide them, i'll review and commit patches.
Comment #2
Julien PHAM CreditAttribution: Julien PHAM commentedbtw, if I have a drupal website with attachment module, and then I upgraded my drupal version to 5.0, as there is no 5.0 version of attachment, what happens to my old files attached to nodes? They are still here, but i cannot access them anymore...
Comment #3
drewish CreditAttribution: drewish commentedWell the project page has been pretty clear:
Comment #4
Julien PHAM CreditAttribution: Julien PHAM commentedI know... something I'm trying to figure out is how to modify existing nodes to use core "upload" module instead of attachment then...
Comment #5
pamu777 CreditAttribution: pamu777 commentedI think many of Drupaler want this module updated, and this will be better if the module have Ajax update...
please update...
Comment #6
jonfhancock CreditAttribution: jonfhancock commentedI have successfully made the module post new attachments to a node.
The trouble I'm having now is displaying the attachments for a node.
Here is the 4.7 code
I understand there have been changes to the hook_nodeapi, but I don't understand how to implement them.
Here is the proposed 5.0 code:
Can somebody tell me where I'm going wrong?
Attached is my progress.
Comment #7
jonfhancock CreditAttribution: jonfhancock commentedWell, I was mistaken.
I am not successfully posting new attachments. However, I am successfully displaying old attachments.
Attached is a stripped version of the module whose purpose is just to display old attachments (backward compatibility). I suggest you use this for old nodes, and enable upload.module for new ones.
Comment #8
dmuth CreditAttribution: dmuth commentedI too would like to see this module upgraded to support Drupal 5.x. I run several Drupal websites now that depend on this module to store files, and I would like to be able to upgrade those sites someday. :-)
Thanks,
-- Doug
Comment #9
scor CreditAttribution: scor commentedHow about a script moving all the old files from the attachment module dataset to the regular upload module. It would mainly involve a db work. This way, the attachment module wouldn't required anymore.
Comment #10
cscsteve CreditAttribution: cscsteve commentedHere is a patch to port attachment to 5.1. I already handled filemanager, so you'll have to go get the patch from http://drupal.org/node/99016 The two modules now work well for me.
Comment #11
drewish CreditAttribution: drewish commentedsame complaints on the .install file as in #99016. also if you're going to offer a hook_deinstall() implementation you should delete variables too.
in the .module overall things look good. mostly style things
in attachment_form_alter() what's the purpose of the $old_type variable?
i think that:
could be simplified to:
i like to put the hook_menu implementations toward the top of the file. it makes it easy to see what urls the module provides and what functions do it. kind of like a little table of contents. that's just a personal preference.
review the drupal coding standards for:
- array declarations in attachment_nodeapi($op='view') and attachment_link()
- function declarations in attachment_nodeapi($op='prepare')
why are you using strcmp() in theme_attachments()?
so plenty of little fixes but like i said things seem good.
Comment #12
matt_paz CreditAttribution: matt_paz commentedI had to move on, so I personally don't need this now. If someone decides to work on a 6.X version, I'd revisit it then.
Thanks,
Matt
Comment #13
cscsteve CreditAttribution: cscsteve commenteddrewish,
Ok, I think I've got it per Drupal coding standards, but feel free to comment. :) One specific item I didn't understand was: "- function declarations in attachment_nodeapi($op='prepare')" Not sure what the problem there was.
For your specific questions:
* .install file: I hate spurious error messages. It causes the end user to go looking for a solution to a problem that doesn't exist or causes insecurity about the module. Hence testing if db_table_exists(). Besides, I assume 5.0 added that function for a reason; might as well use it. However, the rest of your comments are corrected for: changed some minor formatting and added the calls to delete the variables.
* "in attachment_form_alter() what's the purpose of the $old_type variable?"
For some reason "case 'node_type_form' needed it to work. This is per item #20 in the "Converting 4.7.x modules to 5.x" document. http://drupal.org/node/64279#node-type-settings
* "i like to put the hook_menu implementations toward the top of the file."
Done and good point.
* "why are you using strcmp() in theme_attachments()?"
This is to avoid something ugly that annoyed me. The title field defaults to the filename text. So without it you get the link in the node looking like "filename (filename)" if the user didn't see fit to change the title.
For your convenience per your comment in the filemanager patch, I added myself to the CREDITS file. :)
The new patch is stand-alone against the orig sources and shouldn't be applied over my previous patch.
Comment #14
cscsteve CreditAttribution: cscsteve commentedThis has now been added to CVS and a new 5.x Dev release created. Please update your sites and let me know if you have any problems. If I haven't heard of any major issues with this update, I'll produce an official release in a few weeks.
Comment #15
(not verified) CreditAttribution: commented