Home › Forums › Calendar Products › Events Calendar PRO › Tribe__Rewrite::remove_percent_placeholders() error
- This topic has 1 reply, 2 voices, and was last updated 5 years, 10 months ago by Ethan Wilson.
-
AuthorPosts
-
June 5, 2018 at 9:23 am #1546465Ethan WilsonParticipant
I am having an issue where, occasionally on theme update, plugin activation, etc in the wp admin area, my permalinks break and cause my site to go down. The error that is thrown is the following.
Argument 1 passed to Tribe__Rewrite::remove_percent_placeholders() must be of the type array, null given in /wp-content/plugins/the-events-calendar/common/src/Tribe/Rewrite.php:142
Stack trace:
#0 [internal function]: Tribe__Rewrite->remove_percent_placeholders(NULL)
#1 /wp-includes/class-wp-hook.php(286): call_user_func_array(Array, Array)
#2 /wp-includes/plugin.php(203): WP_Hook->apply_filters(NULL, Array)I do not know if this is an issue with a plugin conflict or an error in your plugin, but I do know that the following code fixes the issue. This code is placed in plugins/the-events-calendar/common/src/Tribe/Rewrite.php on line 142. All I added was the ability to check if $rules is null or not.
public function remove_percent_placeholders( $rules ) {
if($rules && is_array($rules)){
foreach ( $rules as $key => $value ) {
$this->replace_array_key( $rules, $key, str_replace( self::PERCENT_PLACEHOLDER, ‘%’, $key ) );
}
}return $rules;
}If you have another suggestion that doesn’t require me to edit the plugin, I would greatly appreciate it! Or if it doesn’t break anything, maybe altering the function to check if $rules is null or an array would be very helpful to me.
June 6, 2018 at 2:18 am #1547175AndrasKeymasterHi Ethan,
Thanks for reaching out to us. I’m sorry to hear about this issue.
In order to be able to support you I will need some further information.
Can you please share your system information with me in a private reply.
What is the permalink structure you are using? Can you share a screenshot of your Settings > Permalinks page?
Do you also get the same when you are using a default theme like twentyseventeen? Can you run a conflict test and see if that brings up anything?
Thanks!
Andras
June 28, 2018 at 9:35 am #1563709Support DroidKeymasterHey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.
Thanks so much!
The Events Calendar Support Team -
AuthorPosts
- The topic ‘Tribe__Rewrite::remove_percent_placeholders() error’ is closed to new replies.