Issue 18164

URGENT: Help with replacing/updating Drupal attachment

Reporter: kylecopas
Assignee: mblissett
Type: Feedback
Summary: URGENT: Help with replacing/updating Drupal attachment
Resolution: Fixed
Status: Closed
Created: 2016-01-20 11:50:53.707
Updated: 2016-02-10 10:42:42.163
Resolved: 2016-01-20 13:50:26.544
Description: I'd like to swap out and replace a proposal template for BID. The initial file (linked from this page) was here located in:

I've tried to replace the updated template, but I have a new URL with my name in it:

Whether we change location of the file in the directory or redirect the original file, these URLs need to resolve.

Many thanks,
Kyle ]]>

Author: mblissett
Created: 2016-01-20 13:43:15.151
Updated: 2016-01-20 13:47:42.763
I've replaced the first file with the second, and it seems to work for me.  I'll ask Burke to check that what I've done is appropriate.

Morten has updated the URL in the page.

Author: mblissett
Created: 2016-01-20 13:46:57.676
Updated: 2016-01-20 13:47:27.243
[] I just did

{{mv /var/www/html/drupal/sites/default/files/gbif_project/files/BID-Regional-Grant-Proposal-Template.doc /var/www/html/drupal/sites/default/files/gbif_project/files/BID-Regional-Grant-Proposal-Template-Old-Moved-Here-By-Matt-2016-01-20.doc}}

{{cp /var/www/html/drupal/sites/default/files/users/kylecopas/BID-Regional-Grant-Proposal-Template.doc /var/www/html/drupal/sites/default/files/gbif_project/files/BID-Regional-Grant-Proposal-Template.doc}}

If that's not going to stay, could you let me know how to make it stay?  (I don't see why it shouldn't.)


Comment: This should work, though manual change in the file system by-passes Drupal which shouldn't be a big issue. Seeing this issue being closed I assume it worked fine? But I'll check whether there is anything malfunction that prevents it from being updated via node form.
Created: 2016-01-22 13:21:37.805
Updated: 2016-01-22 13:21:37.805

Author: kylecopas
Created: 2016-01-22 13:28:44.698
Updated: 2016-01-22 13:28:44.698
It did work fine. Can't judge it from a procedural pov.

I would like to have a look at the how and why of the personal site_file directory—don't much care for that feature. 

Created: 2016-02-10 10:42:42.163
Updated: 2016-02-10 10:42:42.163
I've just looked at the update of this file.

It seems the file in the news item was manually linked by looking up the file location of this project content:
So we can tell that the file is managed by Drupal inside the "gbif_project" directory.

In this case, to replace the file, one can go to the project content and simply remove the existing one and upload a new one:
And as long as the file name is the same, we don't need to update the news item.

I know for news item editing this is not intuitive, though it's the restriction given the scope of program/project content only wants files to be attached with the content, instead of making files a generic resource which can be referred by any active content type. This requirement should be considered in the future if there would be new content type created in Drupal.