WordPress.org

Make WordPress Core

Opened 6 years ago

Last modified 2 years ago

#25769 new defect (bug)

import vs DISALLOW_FILE_MODS

Reported by: Denis-de-Bernardy Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 3.7.1
Component: Import Keywords: has-patch needs-refresh
Focuses: Cc:

Description

When DISALLOW_FILE_MODS is set to true, you cannot install an importer from the plugin repo.

Visiting Tools / Import yields the following screen:

If you have posts or comments in another system, WordPress can import those into this site. To get started, choose a system to import from below:

No importers are available.

That first line should be changed to explain that file mods are disabled and that the plugins must be installed manually. Better yet, the list should point to the relevant plugins in the repo and highlight that they need to be installed accordingly.

Attachments (1)

25769.diff (1.1 KB) - added by Ipstenu 6 years ago.
Moved 'to get started...' so it only shows if you CAN import.

Download all attachments as: .zip

Change History (6)

@Ipstenu
6 years ago

Moved 'to get started...' so it only shows if you CAN import.

#1 @Ipstenu
6 years ago

The list is empty because get_importers() is empty.

Attached is a first pass that just moves the 'If you have posts or comments in another system...' down to the check if importers are empty, and only shows if they're not (this way we don't have to update strings yet).

The if empty check is where we'll want to put the robust checking in for the various options. Do we know what those would be other than DISALLOW_FILE_MODS?

#2 @Denis-de-Bernardy
6 years ago

@ipstenu: off the top of my head, try checking if the user can install plugins. The relevant cap is probably 'install_plugins' or something along those lines.

#3 @Ipstenu
6 years ago

That looks like it. I'm not sure if it'd be better to change "No importers are available." to something that says 'because none are installed and you don't have access to do so via WordPress. Plugins must be installed manually.' or change that whole check to something crazy robust and check all the permutations.

#4 @chriscct7
4 years ago

  • Keywords has-patch needs-refresh added
  • Severity changed from minor to normal

#5 @swissspidy
2 years ago

See also #38673.

Note: See TracTickets for help on using tickets.