Upgrade to 1.5.0 - two issues: can't edit archives (tags and categories) and Warning: preg_match: no ending delimiter

Hallo,

haven’t found a topic with my issues:

  1. edit archives

I cannot edit archives after upgrading - for me it’s important, because I added some brief introductories before the list of posts. I use the genesis framework on 5 sites. Only a grey screen is shown using php 8.1. On one site using php 7.4 there is a message:

Fatal error: Uncaught Error: Call to undefined function is_taxonomy_viewable() in /homepages/23/yyyyyyyyyyy/htdocs/xxxxxxxxxxxx/wp-includes/admin-bar.php:731 
Stack trace: 
#0 /homepages/23/yyyyyyyyyyy/htdocs/xxxxxxxxxxxx/wp-includes/class-wp-hook.php(287): wp_admin_bar_edit_menu(Object(WP_Admin_Bar)) 
#1 /homepages/23/yyyyyyyyyyy/htdocs/xxxxxxxxxxxx/wp-includes/class-wp-hook.php(311): WP_Hook->apply_filters(NULL, Array) 
#2 /homepages/23/yyyyyyyyyyy/htdocs/xxxxxxxxxxxx/wp-includes/plugin.php(524): WP_Hook->do_action(Array) 
#3 /homepages/23/yyyyyyyyyyy/htdocs/xxxxxxxxxxxx/wp-includes/admin-bar.php(86): do_action_ref_array('admin_bar_menu', Array) 
#4 /homepages/23/yyyyyyyyyyy/htdocs/xxxxxxxxxxxx/wp-includes/class-wp-hook.php(287): wp_admin_bar_render('') 
#5 /homepages/23/yyyyyyyyyyy/htdocs/xxxxxxxxxxxx/wp-includes/class-wp-hook.php(311): WP_Hook->apply_filters('', Array) 
#6 /homepages/23/yyyyyyyyyyy/htdocs/xxxxxxxxxxxx/wp-includes/plugin.php(458): WP_Hook->do_action(Array) 
#7 /homepages/23/yyyyyyyyyyy/htdocs/xxxxxxxxxxxx/wp-admin/admin in /homepages/23/yyyyyyyyyyy/htdocs/xxxxxxxxxxxx/wp-includes/admin-bar.php on line 731
  1. warning

The other topic - the warning regards wp/includes/post-thumbnail-template on line 165 : no endig delimiter “/” (I opened post-thumbnail-template file, but don’t know where to add the “/” in line 165.

Thanks for help!

Sönke

Hi,

First thing, make sure you use PHP 8.0 as we don’t support officially 8.1 yet. But, PHP 7.4 should not have issues.

First thing I would try testing a different theme to see if the error persists. If the error is gone with a different theme then your original theme is causing the error.

Second thing to check is file/folder permissions. All folders should be 755 and files 644. If you’re not sure how to check it, let us know what type of hosting do you have - cPanel, Plesk, VPS, etc.

Third thing to check is disabling plugins to see if error is gone. If it’s gone after disabling all plugins that means one of you plugins is causing the error. You can activate one plugin at a time to find the culprit.

Last thing to do is re-install ClassicPress core. Only core files need to be replaced. Upgrades can corrupt files due to network issues or server issues, so sometimes re-installing is necessary. If you reach this step and issues persist, I can provide instructions to do this.

Start with the first 3 and make sure you use PHP 7.4 for this to eliminate any other problems.

Hallo,

  • php 7.4 enabled - nothing changed,
  • another theme (not genesis) - nothing changed,
  • file/folder permessions 755/644 - nothing changed,
  • disabled all plugins - nothing changed,
  • downgraded classicpress to 1.4.4 - ok!
  • upgraded - same issues with editing archives and warning …

Hm … I really do not know what to do …

Thanks for help!

Soenke

For a quick fix you can add this code you can add this code in your theme functions.php.
Hope it works. I’ve tested adding in an utility plugin.

 if ( ! function_exists( 'is_taxonomy_viewable' ) ) :
function is_taxonomy_viewable( $taxonomy ) {
	if ( is_scalar( $taxonomy ) ) {
		$taxonomy = get_taxonomy( $taxonomy );
		if ( ! $taxonomy ) {
			return false;
		}
	}
	return $taxonomy->publicly_queryable;
}
endif;

For the second warning the missing slash is this:
'/(^|&)loading=/'

Please do it with care because I’m away with just my phone so there can be mistakes…

3 Likes

:grinning:

:heart_eyes:

thank you very much, everything is working fine!!!

2 Likes

@Soenke2 thanks for reporting the issue. We did find a function is_taxonomy_viewable() CP doesn’t use slipped through our testing, so it was causing your error. We have a fix, it will most likely come out in 1.5.1 but you do have a temporary fix for now provided by Simone.

Please report any other issues you find.

@Soenke2

Can you tell me a little bit more about the second issue - the warning - you were seeing.

Was that something you could see displayed on your site or was it just in the error logs? If you could see if on the site, where did you see it - steps to reproduce the issue if you could provide them would be very useful for me.

Hallo,

it was displayed on site (frontend) as warning …

… I saw it in the “yarpp”-plugin and in archive-lists of posts in every single “excerpt” (I call titles, “excerpts” and thumbnails by calling them like:

echo get_the_post_thumbnail(null, ‘portfolio’, ‘title=zum Beitrag’);

echo’ the_title();

echo get_post_meta($post->ID, ‘cpseo_description’, true); …

Sönke

1 Like

Thank you for the update, I can see for that first line in the code above that you posted why you were getting the issue, that is the same implementation I used to trigger the issue locally.

I’m happy we know the issue, can reproduce and confirm the fix - thanks for the information.

We will aim to get this patched in a 1.5.1 release, hopefully in the next 2 weeks.

1 Like

FYI, the functions that start with the_ already echo their result.

Thanks,

I did it like

echo '<strong>';
	the_title();
echo '</strong>';

to customize the title …

probably this does not confirm to the rules of art but … it works and does not produce errors.

Sönke

That works, but there are always multiple ways to do things. That particular function has parameters for what should go before and after it, so it could also be used as
the_title( '<strong>', '</strong>' );

Or since styling should really be handled with CSS instead of HTML,
the_title( '<span class="a-title">', '</span>' );
and style the a-title class however you want, even differently on different pages (use body classes added by core to distinguish).

2 Likes

Done …

it works … now customizing spans is much easier … code is in some way clearer …

Thanks very much (looked for some code like this … but have not found it)!!!

2 Likes

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.