탐색 건너뛰기

Resolved

Resolved in: WPML 4.7.6

Topic Tags: Compatibility

Overview of the issue

With Elementor Pro widget advanced settings can add Display Conditions, e.g. to only show a widget if the user is logged in.

Recently something changed with how Elementor stores this data, and it can trigger the following error:

1
PHP Fatal error:  Uncaught TypeError: Cannot access offset of type string on string in .../wp-content/plugins/sitepress-multilingual-cms/addons/wpml-page-builders/classes/Integrations/Elementor/Hooks/DisplayConditions.php:138

Workaround

We will update our code to handle this change in Elementor data storage. In the meantime you can edit this plugin file: wp-content/plugins/sitepress-multilingual-cms/addons/wpml-page-builders/classes/Integrations/Elementor/Hooks/DisplayConditions.php

Locate the function convertConditionIds (from line 134 in the current version), and replace it with the code below:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
private function convertConditionIds( array $conditionGroups ) {
 
    // ensure $conditionGroups is an array of arrays and not just an associative array
    $result = array_keys($conditionGroups)[0] !== 0 ? array($conditionGroups) : $conditionGroups;
 
    foreach ( $result as $key => $conditionGroup ) {
        $configForCondition = $this->getConfigForCondition( $conditionGroup['condition'] );
 
        if ( $configForCondition && isset( $conditionGroup[ $configForCondition['field'] ] ) ) {
            $result[ $key ] = $this->convertIdsForCondition( $conditionGroup, $configForCondition );
        }
    }
 
    return $result;
}

답장을 남겨주세요

주제를 유지하고 다른 사람을 존중하십시오. 이 게시물과 관련 없는 문제에 대한 도움이 필요한 경우 지원 포럼을 사용하여 채팅을 시작하거나 티켓을 제출하십시오.

다음 태그를 사용할 수 있습니다.
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>