As in issue #1238344: Allow other modules to generate images for devel_generate it should be possible to add media files/images to the "file.devel_generate" as well.
I use the same idea with setting a variable, but in this case only if the file widget is "media".

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

bobodrone’s picture

Status: Active » Needs review
FileSize
1.07 KB

Here is the patch!

rerooting’s picture

FYI this patch does not seem to work with the new media 2.x 'media asset' field.

bobodrone’s picture

Hei rerooting,

True, this patch is only for the File field (supported by devel generate) and when using the "media widget" for the File field to make it possible to use the devel generate with a custom media/image source rather than using the devel generate source for images. To use it with the "media field" we might add support for that field in devel generate first in some way and then do the same kind of variable. I just noticed that there is a work going on for this at http://drupal.org/node/1198820. Will look into it L8!

Thanx for pointing this out!

/ Bobodrone

bobodrone’s picture

There is now a working patch for media fields as well, to be found here: http://drupal.org/files/1198820-mediafield-devel-generate4.patch . For the history read this issue: http://drupal.org/node/1198820#comment-6208072

rerooting’s picture

Thanks for the help, I found that thread shortly after I posted #2 and am helping them test it!

rerooting’s picture

Update: That patch has been tested and works great. It looks like it'll end up in Media 2.x shortly. Celebrate! Less you guys have to worry about ;)

salvis’s picture

I'm not sure how to interpret this. Are you saying that this issue is obsolete now because the functionality has been implemented in Media module?

See also #1748302: Lets generate kick-ass demo content!!!

rerooting’s picture

I was just cross-referencing an update regarding the patch mentioned above.

rerooting’s picture

To clarify, this patch: http://drupal.org/node/1198820#comment-6208100 works fine, though it has not been committed (I don't think).

timbrandin’s picture

This can be solved if we take a look at this:
https://drupal.org/node/2011776

In combination with:
https://drupal.org/node/1198820

discipolo’s picture

discipolo’s picture

this patch https://www.drupal.org/node/1589056#comment-6013772 would allow the media module to provide its own devel_generate implementation.

so instead of adding devel_generate functionality for filefields with media widget in devel module (https://www.drupal.org/node/2011776#comment-7505037) this could be done in the media module directly (like https://www.drupal.org/node/1198820 but for filefields instead of media fields)

willzyx’s picture

Status: Needs review » Closed (outdated)

Closing for lack of activity. Feel free to reopen if the issue still exists