Just wanted to ask if this module will later be ported to D7?

CommentFileSizeAuthor
#32 cuff.zip3.07 KBRRRrrr
#31 cuff.zip3.07 KBRRRrrr
#30 cuff.zip3.2 KBRRRrrr
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Heine’s picture

Status: Active » Fixed

As it is a requirement for Drupal.org, it most likely will be ported, eventually.

Heine’s picture

Or what's also likely, replaced with the Drupal 7 field api + filefield.

Heine’s picture

Title: D7 » D7 update to fieldable comments

As I was getting ready to spend an afternoon on fieldable comments for D7, I found that they already are due to #504666: Make comments fieldable.

So, there will not be a comment upload for D7. An update to convert the current files to fieldapi would be a good idea.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

svenrissmann’s picture

What´s about an Update path from Drupal 6 - Comment Upload files to Drupal 7 Filefields?

svenrissmann’s picture

Assigned: blavish » Unassigned
Priority: Minor » Major
Status: Closed (fixed) » Needs work

Please excuse me, but I think it´s ok to reopen this one....!

joachim’s picture

This would help with the upgrade path to FieldAPI: http://drupal.org/project/field_convert :)

blavish’s picture

still no solution>?

StudioARE’s picture

Title: D7 update to fieldable comments » Update path to D7
Status: Needs work » Active
Issue tags: +D7 upgrade path

This is one of the very few modules that keeps me at D6.

No patch in issue, status updated.

izus’s picture

+1

izus’s picture

How do you use #3 and/or #7 to make it work after the D6->D7 upgrade ? does it need a lot of work or there is a "magic" way ?

thanks

joachim’s picture

field_convert in #7 is a framework for writing an upgrade path. It needs a fair bit of work, probably a day or two.

RikiB’s picture

This is also one of the main modules preventing me from going to Drupal 7, especially since tons of our forum posts have images and so on. Hopefully an upgrade path will arise, thanks for the hard work everyone!

benjamin_dk’s picture

subscribing

StudioARE’s picture

Any progress?

This really is the only thing that keeps me on D6.

rfay’s picture

Status: Active » Needs review

I've created an upgrade path in http://drupal.org/sandbox/rfay/1292764

You can download the tarball and try it out.

To use it:

  1. Install the module on a site already upgraded from Drupal 6 that had comment_upload. (Just enable the comment_upload module no matter what directory it's installed in)
  2. Run update.php
  3. Disable and uninstall the module to remove the remains of D6 tables and variables.

Issues:

  • It's up to you to configure the field settings after the migration.
  • This brings the comment_upload files in as imagefields, although one of the options in the D6 version was basically a filefield. That means that you can't work with anything except image files. Somebody could easily provide a patch that changes the file type to a filefield when the variable 'comment_upload_images_<type>' variable is 'none'.

Please try it out and see if it works OK for you.

cweagans’s picture

Title: Update path to D7 » Drupal 7 upgrade path for Comment Driven

Updating title for dashboard.

StudioARE’s picture

Title: Drupal 7 upgrade path for Comment Driven » Drupal 7 upgrade path for Comment Upload

"Comment Driven"?

Will be testing #16.

cweagans’s picture

Sorry bout that...looked at a lot of modules today.

svenrissmann’s picture

Hi there,

when I migrate my Site from 6 to 7 I end up with this two Update-Steps won´t work!!

comment_upload module
7002 - Migrate data from comment_upload table into a field_comment_upload field.
7003 - Notify user to uninstall comment upload.

If I start the Update process it jumps to 100% an then shows this message:

The following updates returned messages

comment_upload module

Update #7002
Failed: PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'public://smf-fileupload-448.JPG' for key 'uri': INSERT INTO {file_managed} (uid, filename, uri, filesize, status, timestamp) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5); Array ( [:db_insert_placeholder_0] => 69 [:db_insert_placeholder_1] => 100_5408.JPG [:db_insert_placeholder_2] => public://smf-fileupload-448.JPG [:db_insert_placeholder_3] => 0 [:db_insert_placeholder_4] => 1 [:db_insert_placeholder_5] => 1331021796 ) in drupal_write_record() (line 6975 of /srv/www/drupal7-sites/includes/common.inc).

For every run of update.php it´s another filename, so perhaps something gets done with exactly one file per update run...

Anyone else getting this error?
I´ve already tried it with all non-core Modules disabled, same issue...
Google knows a lot about, but nothing works for me ;-)

Hope somebody could help!

klonos’s picture

svenrissmann’s picture

Thank you!
But I´m not realy sure, if this is realy what happens to me...
All the Attachments of my Site are unter /files, and there is for sure no file which is an upper case version of: smf-fileupload-448.JPG

So for my site this seems not to belong to Case-Sensitivitie!?

svenrissmann’s picture

Ehh!?!
I just compared the PDO-Exception in my Error and the Error in the other Issue....
Why is the filename in my Message: 100_5408.JPG and the URI: public://smf-fileupload-448.JPG ???

As I see it now, something went wrong by updating from D6 to D7 ?!

klonos’s picture

...to be exact, all I did in order to locate your issue was to do a search in all project's issues for "PDOException Integrity constraint violation". The issue that mostly fit your error was #1163740: PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '' for key 2: INSERT INTO {file_managed}. Reading through that issue lead me to #966210: DB Case Sensitivity: system_update_7061() fails on inserting files with same name but different case. Specifically it was catch's comment:

The upgrade path reports are duplicate of #966210: DB Case Sensitivity: system_update_7061() fails on inserting files with same name but different case.

If you're getting duplicate key errors for a table other than {file_managed}, this is the wrong issue to post those in.

Everything else here needs explicit steps to reproduce.

Anyways, point is that your issue does not belong here and continuing any further discussion is off topic.

webchick’s picture

Issue tags: +drupal.org D7, +porting

Tagging for the sprint.

Heine’s picture

An alternative to an upgrade path (for D7, sites I care about) is to create a migration class.

dww’s picture

Issue tags: -drupal.org D7

Drupal.org won't care about this module for D7, since we're not going to have files attached to comments anymore. See #1545922: [META] Issue page redesign for the full story.

Oleksa-1’s picture

Does Anybody have a partched version of #16 for conversion to filefiled (not imagefield) ?

Oleksa-1’s picture

Who wants module from #16 worked as filefields check this manual http://realguess.net/node/176

RRRrrr’s picture

FileSize
3.2 KB

Module from #16 for conversion to filefiled
This file contain error

See next message...

RRRrrr’s picture

FileSize
3.07 KB

This file worked normally

RRRrrr’s picture

FileSize
3.07 KB

This file worked normally

thermador’s picture

RRRrrr, I wish I could say that the file in #32 worked for me, but it didn't.

I had to edit the "install" file, since my database uses a prefix (tables are "drupal_node" instead of just "node" for example). Basically, anywhere in the file where there was a SELECT command, I had to change the names of the tables that it was selecting.

So like on line 97, instead of

$result = db_query('SELECT DISTINCT type FROM `node` n, `comment_upload` cu WHERE n.nid = cu.nid');

i have this instead

$result = db_query('SELECT DISTINCT type FROM `drupal_node` n, `drupal_comment_upload` cu WHERE n.nid = cu.nid');

But even with those fixes, I still got an error message when I ran update.php:

The following updates returned messages
comment_upload module
Update #7001

Created field_comment_upload fields on types forum

Update #7002

Failed: PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'public://issues' for key 'uri': INSERT INTO {file_managed} (uid, filename, uri, filesize, status, timestamp) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5); Array ( [:db_insert_placeholder_0] => 5712 [:db_insert_placeholder_1] => ScreenShot15.jpg [:db_insert_placeholder_2] => public://issues [:db_insert_placeholder_3] => 4096 [:db_insert_placeholder_4] => 1 [:db_insert_placeholder_5] => 1352173783 ) in drupal_write_record() (line 7036 of path-to-drupal/includes/common.inc).

Oh well... it was worth a shot. I am just going to move all the files manually, it's not that many.

Rhino-new’s picture

My gratitude to Rfay for the upgrade path in #16 , it worked perfectly for me.

So there will never be a comment upload in Drupal7? Any alternatives?

Konstantin Komelin’s picture

Issue summary: View changes

Here is upgrade path from D6 to D7: https://github.com/konstantin-komelin/comment_upload
It's based on #32 but has a bunch of improvements.

Moreover, it has a Comment Upload file field formatter! So it can be used as a complete replacement of the D6 Comment Upload module for D7. Read more in README.md

If people are interested and maintainers don't mind it's possible to have this module as 7.x-1.x branch of Comment Upload module here on drupal.org.

Enjoy the module! I hope it will be useful for the community.
Konstantin

AndersTwo’s picture

FYI: I did a successful migration using migrate_d2d module. Here’s what you need to do:

  1. Duplicate the migrate_d2d_example folder inside the migrate_d2d module (just to keep the original as a backup), make it visible, rename it to get a module that you can modify to your needs.
  2. Implement your migration classes, following the example code. Note that the current example does not include comment nodes, but they are straight forward.
  3. The current example code also has a bug: In migrate_d2d_example_migrate_api() the $api array is created with a wrong nesting. The key 'migrations' needs to be at the top level of the array.
  4. In your migration class(es) for comments, use the solution explained here: https://www.drupal.org/node/1819704#comment-9172311

So basically this boils down to simply extending the query to retrieve all attached file IDs in a single result row, separated by commas. This seems to work only with MySQL or MariaDB, although I haven’t checked if other databases would possibly support this too.

With other databases, one would need to retrieve the file IDs in a separate query on a per-row basis. IIRC, the migrate API provides something like prepare_row() or similar that could possibly be used.

In any case, once you got the fid’s separated by commas, you’re fine to use this solution.