Ivan Antipov
Forum Replies Created
-
Hi Dan,
First very glad you’re picking up the development again – I’ve been fixing some PHP 8 errors myself as I haven’t been able to find a better solution for what we needed. A couple more errors came up on a production site as the host had the function disabled:
PHP Fatal error: Uncaught Error: Call to undefined function php_uname() in /document-gallery/inc/thumbers/thumber-co/class-thumber-client.php:28
PHP Fatal error: Uncaught Error: Call to undefined function php_uname() in /document-gallery/inc/thumbers/thumber-co/thumber-client/client.php:89
@bernicechua thanks, background videos now working both as a background and a container background.
I second that – using a video background on the Hero block, upon update showing error offering to attempt recovery, then video disappeared from the front-end. When switched to adding a video in the background as opposed to container, the container inherits the video also, even when it’s not set.
Quite simply, change
/includes/assets.php:178
toif ( is_array( $scripts ) ) {
return array_merge( $scripts, $view->scripts( $min ) );
} else {
return $view->scripts( $min );
}or similar – untested.
@rosinghal Yes – changing to
add_filter('simcal_front_end_scripts', '__return_empty_array');
worked, however you should also add a type check there.Just debugged and found the cause – using
add_filter('simcal_front_end_scripts', '__return_null');
in the theme – changing it to
add_filter('simcal_front_end_scripts', '__return_empty_array');
worked. There should be a check for the data type in the plugin, otherwise works fine.
Hi @rosinghal, @johnweru,
Any update on this error? Breaking on PHP 8+ only, 7.4 works fine. Only reason I can’t upgrade the entire server to PHP 8.
@rosinghal thank you – as mentioned, it’s on 3.1.37.2, fails on both localhost and staging.
Fails for me too @ 3.1.37.2, PHP 8.2:
Fatal error: Uncaught TypeError: array_merge(): Argument #1 must be of type array, bool given in /wp-content/plugins/google-calendar-events/includes/assets.php:178?
Forum: Plugins
In reply to: [Document Gallery] PHP 8.1 compatible?Another PHP 8 fix was changing the order of parameters in
inc/class-gallery.php:544
toimplode( ', ', $ids )
.Shame the project was abandoned, does what I needed really well.
@kalmika one, this appears to be a different plugin, two, we need a solution that doesn’t require editing plugin files. Would be great to hear from the author, also why manual schema.org tags seem to be filtering out of the template.
Forum: Plugins
In reply to: [Polylang] Polylang – switching language on the fly and duplicate URL'sOK that didn’t quite work – however this did, at the top of single.php:
global $wp_query, $polylang; if($wp_query->post_count > 1) { foreach($wp_query->posts as $k=>$found_post) { if($polylang->get_post_language($found_post->ID)->slug == pll_current_language()) { $wp_query->post = $wp_query->posts[$k]; $wp_query->queried_object = $wp_query->posts[$k]; $wp_query->queried_object_id = $wp_query->posts[$k]->ID; if(!$wp_query->posts[0]) { $wp_query->posts[0] = $wp_query->posts[$k]; unset($wp_query->posts[$k]); } } else { unset($wp_query->posts[$k]); } } $wp_query->post_count = count($wp_query->posts); $wp_query->found_posts = count($wp_query->posts); }
No need to check the post lang in the while loop.
Forum: Plugins
In reply to: [Polylang] Polylang – switching language on the fly and duplicate URL'sI may have found a fix – turns out it will display both post contents if the posts have the same URL – naturally, being part of a while loop. Just needed to filter out the correct language in single.php after
the_post()
(rather crudely, so feel free to point out a better solution):global $polylang; if($polylang->get_post_language(get_the_ID())->slug !== pll_current_language()) continue;
There’s still an issue with hreflang attributes pointing to the current language domain only, so I’m adding this to frontend-links.php:129 (again, rather crudely, so please feel free to provide an alternative):
if ($url = $this->get_translation_url($language)) { $url = str_replace(pll_home_url(), pll_home_url($language->slug), $url); $urls[$language->slug] = $url; }
Forum: Plugins
In reply to: [Polylang] Polylang – switching language on the fly and duplicate URL'sOK… that’d be critical if we were to move the existing blogs over so we’ll stick with what we have for now – but I’ll definitely keep an eye on new features, Polylang is a superior solution by far.
Forum: Plugins
In reply to: [Polylang] Polylang – switching language on the fly and duplicate URL'sThat’s exactly what I needed – to be able to force set a language regardless of the URL. Didn’t work inside the action, but did outside of it. Thanks.
This disables the redirection, but it loads the same post content on both URL’s – is there another hack that can fix this?