Page MenuHomePhabricator

Unable to save a CV/resume with some configurations
Closed, ResolvedPublic

Description

$wgFileStore was removed in mediawiki 1.24.

https://www.mediawiki.org/wiki/Manual:$wgFileStore

Replace it with $wgDeletedDirectory

https://www.mediawiki.org/wiki/Manual:$wgDeletedDirectory

Steps to reproduce

  • Go to <wikidomain>/index.php/Special:ConfirmAccounts/authors
  • Try accepting a user registration ( Note if ones not there create them by clicking request account link at top of page. )

Actual results

  • I get this error

[10-Dec-2015 17:14:19] PHP Warning: failed to mkdir "/accountcreds/p/pa/pal" mode 0777 [Called from wfMkdirParents in /home/paladox1/public_html/includes/GlobalFunctions.php at line 2573] in /home/paladox1/public_html/includes/debug/MWDebug.php on line 300

Expected results

  • Replace with something similar like $wgDeletedDirectory.

Event Timeline

Paladox raised the priority of this task from to Needs Triage.
Paladox updated the task description. (Show Details)
Paladox subscribed.
Paladox removed a subscriber: aaron.

@Legoktm could I add you to the task.

Neeed help to replace the removed function since that means this extension.

Paladox triaged this task as High priority.Aug 21 2016, 1:59 PM

Changing to high since the config was removed.

@Paladox: It was removed in 1.24 which was released years ago. Why has this suddenly become urgent? ("Something was removed" is not a generic reason for high priority, especially not if it wasn't used too much.)
@Paladox: Did Aaron explicitly agree on being CC'ed here?

@Aklapper nope and because I think this may be the reason why it isent correctly saving or deleting it in the images folder.

Aklapper raised the priority of this task from High to Needs Triage.Aug 22 2016, 7:24 AM

I studied this extension and this bug. The original bug was fixed in almost all supported MW version (only 1.26 is missing). The description suggests changing $wgFileStore but this is unrelated to the actual bug (so possibly a new issue should be opened).

About the actual error described in the description

The error failed to mkdir "/accountcreds/p/pa/pal" was solved with https://gerrit.wikimedia.org/r/#/c/258373/, closing this bug: when the extension is activated with require_once before $wgUploadDirectory is set, the resulting directory is "/accountcreds" and only the root user can create this directory (which is aside /bin, /etc, etc.), so the solution was to differ the evaluation of this parameter using wgExtensionFunctions.

Hence this bug is solved in the following currently-supported environments (tested by myself):

  • MW 1.23: no bug when using the extension branch REL1_23
  • MW 1.26: bug: extension branches REL1_27 and master cannot be used because they call a newer MW function (ObjectCache::getLocalClusterInstance), REL1_26 doesn’t contain the fix
  • MW 1.27: no bug when using the extension branches REL1_27 and master
  • MW 1.28: no bug when using the extension branches REL1_28 and master
  • MW 1.29alpha: no bug when using the extension branch master

About $wgFileStore

It was indeed removed in MW 1.24. The comment just above in the code clearly says it is kept for B/C and given it is a default value I don’t see any harm in keeping it. If something should be changed, it would not be related to $wgDeleteDirectory, since the goal here is to store viewable files, not deleted files ($wgFileStore was historically only used for deleted files, but the use in this extension is about storing viewable files, unrelated to deleted files).

In nowadays config, possibly it could be checked if a (foreign) repository exists instead of just a wrapper around a file backend (FSRepo, deprecated since MW 1.19), but this would be an architecture change which should be decribed and discussed in a dedicated issue with a broader perspective.

Change 323688 had a related patch set uploaded (by Seb35):
Fix permission denied

https://gerrit.wikimedia.org/r/323688

Seb35 renamed this task from Remove $wgFileStore and replace with something similar like $wgDeletedDirectory to Unable to save a CV/resume with some configurations.Nov 27 2016, 5:37 PM
Seb35 triaged this task as Medium priority.

I have landed @Seb35 backport of the patch for REL1_26.

This should now be resolved with @Reedy's change on the master branch.

Reedy claimed this task.