How to reproduce:

  1. Enable private files
  2. Upload a private file
  3. Enable file_entity
  4. Go to the edit page for the file and attempt to save it

Results:

Expected Results:

  • If the file uses a missing stream wrapper: ???
  • If the file uses a valid stream wrapper but not assigned to the file type: show a warning and a disabled radio for the current scheme?

Maybe a better question, is why file types need to care about schemes at all? This seems to complicate things greatly.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Dave Reid’s picture

Alternatives, should the file type schemes only matter when creating new files?

Dave Reid’s picture

Dave Reid’s picture

I will clarify, I don't think we should remove the scheme selection from the upload form. That seems to be a function that lots of people would actually use. I just don't think there should be any type of association between file type and schemes.

Dave Reid’s picture

The second expected result would be solved by #1979832: Remove schemes from file types

Dave Reid’s picture

Title: Files with a missing scheme or scheme not assigned to file type cannot be edited » Files with a missing scheme cannot be edited

Reducing scope now that #1979832: Remove schemes from file types is committed.

Dave Reid’s picture

Moving to beta blocker

Dave Reid’s picture

Issue summary: View changes
FileSize
51.85 KB
pbuyle’s picture

I tried to reproduce (manually and using simpletest, see attached path) the issue following the steps in the issue without success (ie. I can edit the file alright).

So the issue is either already fixed, or we need to figure another way to reproduce it.

pbuyle’s picture

Status: Active » Needs review
pbuyle’s picture

Assigned: Unassigned » pbuyle

After discussion with Dave, the missing step is to disable private files before the edit. I'll work on that.

pbuyle’s picture

Assigned: pbuyle » Unassigned
Status: Needs review » Needs work
Issue tags: -7.x-2.0 beta blocker
FileSize
1.52 KB

Disabling private files with variable_del('file_private_path'); right before enabling the File Entity module in the test case cause the test to fail because of the following error:

Warning: filesize(): Unable to find the wrapper "private" - did you forget to enable it when you configured PHP? in file_save() (line 601 of /var/www/site/docroot/includes/file.inc).
Warning: filesize(): Unable to find the wrapper "private" - did you forget to enable it when you configured PHP? in file_save() (line 601 of /var/www/site/docroot/includes/file.inc).
Warning: filesize(): stat failed for private://Файл для тестирования ewrTpGZo in file_save() (line 601 of /var/www/site/docroot/includes/file.inc).

These three are to be expected for a file with a missing file wrapper.

The file entity can still be edited, so the issue is no longer a beta blocker.

Devin Carlson’s picture

Status: Needs work » Needs review

Sending to the testbot to review the failure in #11.

Status: Needs review » Needs work

The last submitted patch, 11: file_entity-edit_file_with_no_scheme-1979804-11.patch, failed testing.