Joomla : how to fix "Undefined property: AriDocsViewerContentPlugin::$stripUSC"? - php

I try to install the ARI Docs Viewer plugin of Joomla in localhost and I always have the following error: " Undefined property: AriDocsViewerContentPlugin::$stripUSC "
However, all the files to be displayed are all present in the local server.
When I disable the plugin, there is no error on the site and the document does not display.
I’ve already commented the next code tip and the error goes away but the document still does not appear.
if ($this->stripUSC) { // Alternatively:
preg_replace('/[\x{10000}-\x{10FFFF}]/u', "\xE2\xAF\x91", $source) but
it'd be slower. $source = $this->stripUSC($source); }
Does someone here already had this error ?
Thanks a lot!!!

Related

error: Cannot access offset of type string on string

I'm helping a client with getting their website ready for PHP8. After doing the update to the latest Joomla and making sure the template is updated, it runs fine on PHP8. I do however get the following error only on one page. The page where you have to create a new user:
Error: Failed opening required
'/usr/www/users/kznden/libraries/joomla/document/html/renderer/head.php' (include_path='.:/usr/share/php'): Cannot access offset of type string on string
I know this path doesnt exist anymore but how can I get rid of this error and the page working again? I opened the error.php file and believe the error is related to that file. If I'm wrong, please correct me. Specifically the following code:
$doc->setTitle($this->error->getCode() . ' - '.$this->title);
require_once(JPATH_LIBRARIES.'/joomla/document/html/renderer/head.php');
$header_renderer = new JDocumentRendererHead($doc);
$header_contents = $header_renderer->render(null);
Removing
require_once(JPATH_LIBRARIES.'/joomla/document/html/renderer/head.php');
doesn't seem to fix the issue.
enter image description here

Elementor Function is not working properly in Document.php

I am working on a site that suddenly has these error messages:
[25-Aug-2022 16:23:38 UTC] PHP Notice: Undefined variable: post in /public_html/wp-content/plugins/elementor/core/base/document.php on line 250
[25-Aug-2022 16:23:38 UTC] PHP Notice: Undefined property: Elementor\Core\Kits\Documents\Kit::$ in /public_html/wp-content/plugins/elementor/core/base/document.php on line 250
[25-Aug-2022 16:23:38 UTC] PHP Notice: Trying to access array offset on value of type null in /public_html/wp-content/plugins/elementor/core/base/document.php on line 250
[25-Aug-2022 16:23:50 UTC] PHP Notice: Trying to get property 'ID' of non-object in /public_html/wp-content/plugins/elementor/core/base/document.php on line 250
The errors showed up whenever a customer tried to put a variable product into the shopping cart. On the front end it says:
This doesn't happen if the customer adds a non-variable product to the cart, so I am not sure what is happening or how to repair this. I have reached out to elementor with no response at this point after 24 hours.
The code referenced in the error log is:
public function get_main_id() {
if ( ! $this->main_id ) {
$post_id = $this->post->ID;
$parent_post_id = wp_is_post_revision( $post_id );
if ( $parent_post_id ) {
$post_id = $parent_post_id;
}
$this->main_id = $post_id;
}
return $this->main_id;
}
This occurred after the site was moved to a new hosting company, however, the site was working fine for the past three weeks, and the issue wasn't present.
I was able to figure out (With the help of Elementor Tier 2 support) that the hosting provider (Site Grounds) installs a plugin called "SiteGround Optimizer" that was causing this issue. There is a conflict between this plugin and Elementor in case anyone is having this issue.
EDITED: SiteGround was able to turn off the "Defer Render-blocking JavaScript" feature and the plugin worked with the rest of the site. If you are having a strange issue and you are on SiteGround, I highly recommend you turn this feature off to troubleshoot the issue better.
This is occurring on Kinsta too - so it's not just the SG plugin. It could still be optimization related - but I can't seem to find a resolution yet (even rolling back versions isn't helping me).
that issue comes in new version of elementor, just rollback it previous version following this video https://youtu.be/3uwCRcQvIFw

Notice: Trying to get property of non-object in ../libraries/src/UCM/UCMType.php on line 169

When I tried to install the Joomla! extension JCH, I came up with the title message above after finished installing.
I asked the developer and he replied that I don't have to worry about the extension as this is a Joomla! issue that it will not affect the way the extension works.
The line 169 of UCMType.php is the following:
$tableNameFromType = $tableFromType->special->prefix . $tableFromType->special->type;
And the specific part of the UCMType.php that includes line 169:
public function getTypeByTable($tableName)
{
$query = $this->db->getQuery(true);
$query->select('ct.*');
$query->from($this->db->quoteName('#__content_types', 'ct'));
// $query->where($this->db->quoteName('ct.type_alias') . ' = ' . (int) $typeAlias);
$this->db->setQuery($query);
$types = $this->db->loadObjectList();
foreach ($types as $type)
{
$tableFromType = json_decode($type->table);
$tableNameFromType = $tableFromType->special->prefix . $tableFromType->special->type;
if ($tableNameFromType === $tableName)
{
return $type;
}
}
return false;
}
You really do not have to give too much attention for this issue, so the third party extension developer was right in this. This is more like a small bug (thus the Notice is there), not a serious Error. Your site will operate without a problem.
As you see in this Notice, in the foreach(){} loop a variable is tried to be defined from another variable which is not an Object, so it is just getting back a NULL value or another TYPE most probably, which does not have an Object property what is expected there.
In this particular case this whole thing happens in a relatively new Joomla core class and interface (UCM and UCMType). In this class they want to define a content type by table and this part of the code has to be modified, improved by core Joomla developers.
What should you do?
1. If you want to help the development of Joomla and yourself a bit then please report this issue here: https://developer.joomla.org/tracker.html , and they will check and repair this most probably.
2. This PHP (error) Notice is usually for developers, so if your site is a live site you should not see this Notice basically. If you see this on live site, that could mean that either your Joomla error reporting is set incorrectly, or your server error reporting default is set incorrectly.
In your Joomla admin at System->Global Configuration->Server->Error reporting has to be set to System Default or to None. Thus these not relevant notices will not appear for users, visitors of your site. Other settings only recommended if your site is not a live site and you develop that further in a staging copy for example.
And please if you have Joomla questions, visit the Joomla Stack Exchange here: https://joomla.stackexchange.com/questions and please ask your questions regarding Joomla there.
I hope the above cleared the issue for you.

Wordpress theme upload error: Fatal error: Can't use function return value in write context

I'm not a coder, just trying to update my wordpress site! I've bought a theme on Envato called "Birddi". When I try to upload my theme, I got this message :
Fatal error: Can't use function return value in write context in
/websites/ik/ikateyou.com/wordpress/wp-content/themes/birddi/inc/template.functions.php
on line 1748
This crashed my whole site and I couldn't get back into the admin area until I deleted the theme file. (My site is all messed up with a generic theme now so just ignore it)
Is there any way to fix this? I think this is the line...
$video_thumb = !empty(get_the_post_thumbnail_url($zkbirdi_meta_options['zkbirdi_format_video_local']['id'])) ? get_the_post_thumbnail_url($zkbirdi_meta_options['zkbirdi_format_video_local']['id'],'full') : get_the_post_thumbnail_url(get_the_ID(),'full');
Thankyou so much in advance!!
why don't you contact the theme developer
Try replacing that line with:
$video_thumb = get_the_post_thumbnail_url($zkbirdi_meta_options['zkbirdi_format_video_local']['id']);
$video_thumb = !empty( $video_thumb ) get_the_post_thumbnail_url($zkbirdi_meta_options['zkbirdi_format_video_local']['id'],'full') : get_the_post_thumbnail_url(get_the_ID(),'full');
In earlier versions of PHP empty() should be applied to variables not values. Alternatively, you may upgrade your version of PHP but that may cause even more problems. Incidentally, I think your version of PHP may be very old - 5.4 or older.

Yii - PHP error after content saying that LogDetailFilter couldn’t be found

Ok, I can't figure this one out for the life of me. I'm using Yii 1.1.8.
If I do this:
function actionEdit()
{
$this->render('//user/edit');
}
I get a PHP error after the content saying that LogDetailFilter couldn’t be found when it was trying to autoload it in Yiibase.php on line 421.
But if I do this:
function actionEdit()
{
$this->render('//user/edit');
die;
}
I have no problems. Any thoughts how I could fix this?
It's an error in your config file related to what / how you are logging things. Yii runs all of the Yii::log / Yii::trace calls after it has rendered content (using the onApplicationEnd event), which is why using die prevents your logging from having errors.
If you post your logging info, we can point out the exact spot if you need it

Categories