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.
Can you give some clues where (in code) to copy the Remove URL into other file fields?
I have enabled both the Title and alt fields so I guess this is doable right?
I have trouble finding the correct hook(s) for this.
This way we can declare http://drupal.org/project/remote_file obsolete :-)
Comments
Comment #1
clemens.tolboomThis issue blocks #1186152: Add a D7 migration path to filefield sources module as part of http://drupal.org/project/issues/remote_file :-)
Comment #2
clemens.tolboomI think we need to add a validate function to the processing function right?
then fill in the alt or title value.
Comment #3
quicksketchThe Remote source saves its value in the filefield_source_remote_value() function. The $item argument is passed in by reference, so if you want to save something into the alt or title it would probably be in $item['title'] or $item['alt'].
Comment #4
jdelgama CreditAttribution: jdelgama commentedI think what clemens says is how to store the source url into the field itself.
If you print plain the "field_image" cck field it contains:
I would like to store the source url into the [title] field (not shown to the user) so,
Or even better: to save it into a separate field.....
Is it possible? Any patch? :-)
Comment #5
clemens.tolboomI think we should go for the [url] solution as that does not stand in the way of the normal [alt], [title] workflows.
As files are now fieldable just adding a new field is not so trivial as that may collide with existing [url] user added fields right?
Comment #6
buddaWhat's the need for storing the remote url? I'm not clear what the point is.
If it's to give attribution for stealing the image then it would make sense to generate a general string to go in the alt or title attribute along the lines of 'Image from www.example.com'
Comment #7
onequad CreditAttribution: onequad commentedI've tried setting
near the end of filefield_source_remote_value() as quicksketch suggested, but that didn't work as expected -- the title remained empty. Any help please?
Comment #8
clemens.tolboomIn #6 @budda suggest to add 'Image from www.example.com' to alt or title.
That would indeed help a little. But it still would be great to have the original location.
I now just add the original blog|page link to both title and alt but that is still a little bit ugly. See ie http://build2be.com/content/pinch-symfony-d8mi
Having a separate field for it would help a site owner to tell remote images from local (own).