Change WordPress user roles and capabilities › Forums › Bug Reports › Import Failure: Wrong characters in the capability ID
Tagged: Import
- This topic has 5 replies, 2 voices, and was last updated 7 years, 10 months ago by
jpgalapon.
-
AuthorPosts
-
12/01/2018 at 23:04 #4551
jpgalapon
ParticipantI did an export from our development server and I’m trying to import the file into another test server (to test how the import will work), but I keep getting the following error message: Import failure: Wrong characters in the capability ID – sanitized version: 1
Not sure what I’m doing wrong and I can’t find anything about this error.
13/01/2018 at 02:27 #4554Vladimir
KeymasterAlphanumeric characters, dashes, underscores, spaces and slashes are allowed by default in user capability ID by default. This PHP regular expression is used: /[^a-zA-Z0-9_\-\s\/]/
Look if you have capability with 1 inside but containing not allowed characters. Let me know what it is.
I work on the export/import procedure upgrade. I will add the same filter to the export code in order do not generate this error if some existing capability does not go via this check.
15/01/2018 at 20:01 #4557jpgalapon
ParticipantHi, Vladimir. Thanks for responding. All of our capabilities contain letters, numbers, underscores, and/or dashes.
16/01/2018 at 01:19 #4558Vladimir
KeymasterSend exported .dat file which you can not import to support [at-sign] role-editor.com
I will test it and try to understand what is going wrong.17/01/2018 at 05:32 #4559Vladimir
KeymasterI got the file and isolated the issue. The error message is returned for the ‘1’ capability.
There is a strict type checking at the URE code:if ($key!==$sanitized_key) {But $key contains an integer 1, but $sanitized_key contains string ‘1’. So check is failed and returns error.
I see ‘1’ capability from time to time at different client sites, but still did not have information what plugin can add it. Try to revoke it from all roles to which it is granted. Then delete this capability as unused. Export roles again. This problem with import should gone away.
Thanks for pointing me on this issue. I will enhance a code here.
18/01/2018 at 21:54 #4562jpgalapon
ParticipantHey, Vladimir. I figured out that it is the “FooEvents for WooCommerce” plugin by Grenade creating the “1” capability. After deactivating the plugin, deleting the erroneous capability, and re-exporting, everything worked fine with importing to another site. Thank you so much for all your help!
-
AuthorPosts
- You must be logged in to reply to this topic.