Elementor Function is not working properly in Document.php - 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

Related

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

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!!!

Woocommerce taxes not working after update

I have a big problem with my Woocommerce shop. After upgrading to version 3.6.4 (latest) and WP 5.2.1 suddenly my Woocommerce admin.php page stops loading. Additionally, it seems that taxes are not added to my products and therefore not added in the checkout.
In other words, when opening the taxes page, half the page is loaded but the table with tax info always says "loading".
Looking at the console I see these errors:
TypeError: a.ui is undefined draggable.min.js:11:133
TypeError: a.ui is undefined slider.min.js:11:126
TypeError: a.widget is not a function iris.min.js:4:16724
TypeError: a.widget is not a function menu.min.js:11:138
TypeError: a.widget is not a function autocomplete.min.js:11:147
TypeError: s(...).iris is not a function settings.min.js:1:806
After Googling I found some possible solutions like enqueuing scripts in theme-functions.php. However it works for some scripts (error goes away) but not for settings.min.js for example.
function test_load_scripts($hook) {
wp_enqueue_script('jquery-ui-draggable');
wp_enqueue_script('jquery-ui-menu');
wp_enqueue_script('jquery-ui-autocomplete');
wp_enqueue_script('iris');
wp_enqueue_script('jquery-ui-slider');
wp_enqueue_script('settings', 'wp-content/plugins/woocommerce/assets/js/admin/settings.min.js' );
}
add_action('admin_enqueue_scripts', 'test_load_scripts');
Further I tried to enable/disable plugins. However I think it's coming from the Woocommerce plugin itself since the errors are only visible on the admin pages for Woocommerce.
Does anybody know what cause this? And better how to fix it? I'm pretty new to WP and Woo so I hope someone can help.

Sudden blank page on WordPress Admin Dashboard

My WordPress Admin Dashboard is experiencing an issue which I have never encountered before. I have not made any updates/changes on WordPress and any plugins. Yet, suddenly my WordPress Admin Dashboard has become like the attached image below.
What I have tried so far to fix this issue:
(1) Increased the WP_MEMORY_LIMIT but it did not worked out
(2) Tried to change wp-admin\includes\screen.php on line 706:
from <?php echo self::$this->_help_sidebar; ?>
to <?php echo $this->_help_sidebar; ?>
But my screen.php file has less than 300 lines of code and does not contain <?php echo self::$this->_help_sidebar; ?> in it. So I cannot change it.
(3) Disabled all plugins(10) by renaming the "plugins" folder and it did solved the blank page issue.
(4) I have set WP_DEBUG to TRUE and got the following messages:
Undefined property: wpdb::$connect_errno in /local/www/html/xxxxx/wp-includes/wp-db.php on line 684 Notice: Undefined property: wpdb::$connect_errno in /local/www/html/xxxxx/wp-includes/wp-db.php on line 684 Notice: The called constructor method for WP_Widget in WPAC_Nav_Menu_Widget is deprecated since version 4.3.0! Use
__construct()
instead. in /local/www/html/xxxxx/wp-includes/functions.php on line 3764 Notice: The called constructor method for WP_Widget in Genesis_Featured_Post_with_title is deprecated since version 4.3.0! Use
__construct()
instead. in /local/www/html/xxxxx/wp-includes/functions.php on line 3764 Notice: Constant FORCE_SSL_ADMIN already defined in /local/www/html/xxxxx/wp-config.php 
(5) Disabled the plugins(10) one by one to find out which plugin was the culprit. Interesting enough is that whichever plugin I disabled the blank page issues was still solved . This made it difficult for me to isolate which plugin was the culprit. I might be totally wrong thinking that the plugins may be causing this blank page issues. Currently, I have no idea how to solve/approach this issue and why this is happening.
Any help would be appreciated very much!

WordPress theme error: Call-time pass-by-reference has been removed in theme file

I've just been racking my brain over this one so I hope someone would kindly help me out if possible.
My site is broken right now - it's only showing this error "Fatal error: Call-time pass-by-reference has been removed in home/***/public_html/wp-content/themes/agency/library/init.php on line 31."
I am not able to get to the WordPress admin login or anything. This occurred when I attempted to update the a WordPress theme.
While trying to research an answer, I came across tons of people having this similar error. Most people were able to fix it by removing & out of said line of code in said php file of the error (in my case it would be line 31 of init.php). This unfortunately did not work for me.
I also tried renaming the Agency theme folder to see if WordPress would load up a different default theme. It did not. I got the same error. I also tried deleting the theme folder via FTP. Even though it was deleted, I still got the same error.
I also tried disabling plugins by renaming the plugin folder. No luck there either.
What could it be that I am missing here? Do I need to delete the theme folder from cPanel perhaps? I am incredibly boggled by how I seem to get the same error from a theme folder that doesn't exist (after I deleted the folder).
I would greatly appreciate any assistance with this error. Here is the code the error is referencing - I put the &s back in since it did not seem to matter whether they were there or not.
28 function agency_nav_menu_objects($items) {
29
30 foreach ($items as &$item) {
31 if ( agency_get_menu_object_items($item->ID, &$items) ) {
32 $item->classes[] = 'sub';
33 break;
34 }
35 }
36 return $items;
37 }
Did you changed all &$items to $items in init.php?

Magento 1.7 cannot edit some products

I am on Magento ver. 1.7.0.0 and I can't edit some of the products from the admin backend.
When I tried to change the product description directly using mysql it worked, so then I tried removing parts of the description and then found that
everything till the text 'printer driver lets users transfer data' works but when I added the word 'from' to it ,it didn't work making the paragraph end in 'printer driver lets users transfer data from' did nothing ,neither showed a error nor a successful message it just refreshed the page. It can't be about the length because if I replace the text from to krom it works.
So I tried editing the description to just 'printer driver lets users transfer data from' it worked
From the system.log:
ERR (3): Warning: array_key_exists() expects parameter 2 to be array, null given in //app/code/core/Mage/Adminhtml/controllers/Catalog/ProductController.php on line 507
ERR (3): Recoverable >>ERRor: Argument 1 passed to Varien_Object::addData() must be an array, null given, called in //app/code/core/Mage/Adminhtml/controllers/Catalog/ProductController.php on line 514 and defined in //lib/Varien/Object.php on line 243
ERR (3): Warning: Invalid argument supplied for foreach() in //lib/Varien/Object.php on line 245
The Chrome console tells me :
index.php/admin/catalog_product/validate/id/1/back/edi…roduct_info_tabs_group_7/key/978d8fe4570a41312a7520945e982662/?isAjax=true 500 (Internal Server Error) prototype.js:1530
Ajax.Request.Class.create.request prototype.js:1530
Ajax.Request.addMethods.initialize loader.js:61
(anonymous function) prototype.js:429
klass prototype.js:101
varienForm._validate form.js:80
varienForm.submit form.js:65
saveAndContinueEdit /index.php/admin/catalog_product/edit/id/1/back/edit/tab/product_info_tabs_group_7/key/a325cea2187bfa32cec5c6d0c14e0baa/:2240
onclick
A little PHP debugging tells me that for the product with description error
$product->getAttributes(); was empty but for the working products it was an array.
$attributes = $product->getAttributes();
around line 504 of app\code\core\Mage\Adminhtml\controllers\Catalog\ProductController.php
If I change the following part from the form.js there is no Chrome console error but it still doesn't work:
this.submitUrl = url;
if(this.validator && this.validator.validate()){
if(this.validationUrl){
this._validate();
}
else{
this._submit(); // I removed everything but this
}
return true;
}
If it helps there are 5881 characters before the word 'from' in the description.
I have tried editing in all major browser so there are no compatibility issues.
I believe the problem is somewhere in the javascript but can't find where. Even if I can just remove the validation script from the admin forms I will but I don't think I should and I don't know how.
Any help would be greatly appreciated.
Thanks for your time.
Take a closer look at your .htaccess file. When I migrated my 1.7.0 Magento store to another server I included the .htaccess file from the old server and then the message: "Invalid Form Key. Please refresh the page" popped on screen and nothing happened, not even the configuration changes had effect.
The solution was to install a fresh Magento and then copy the My Store files the the Magento root, excluding .htaccess. When I used the .htaccess from the fresh installation, everything started to work fine. I don't know what exactly happened, maybe each server structure has different and particular .htaccess entries and rules. It works to me.

Categories