Plugin Directory

Changeset 3340860


Ignore:
Timestamp:
08/07/2025 10:02:48 AM (8 months ago)
Author:
smartling
Message:

Update to v 4.3.0

Location:
smartling-connector/trunk
Files:
1 added
6 edited

Legend:

Unmodified
Added
Removed
  • smartling-connector/trunk/inc/Smartling/Base/SmartlingCore.php

    r3338937 r3340860  
    7878            $submission = $this->prepareTargetContent($submission);
    7979            $entity = $this->getContentHelper()->readTargetContent($submission);
    80             $content = $entity->toArray();
    81             foreach ($content as $key => $value) {
     80            $entityStrings = $entity->toArray();
     81            $metadata = $this->getContentHelper()->readTargetMetadata($submission);
     82            $content = ['entity' => $entityStrings, 'meta' => $metadata];
     83            $content = $this->externalContentManager->setExternalContent($content, $content, $submission);
     84            foreach ($entityStrings as $key => $value) {
    8285                if (array_key_exists($key, $lockedFields['entity'])) {
    83                     $content[$key] = $lockedFields['entity'][$key];
     86                    $entityStrings[$key] = $lockedFields['entity'][$key];
    8487                    continue;
    8588                }
     
    8891                        $value = $this->postContentHelper->applyContentWithBlockLocks($target['entity']['post_content'], $value);
    8992                    }
    90                     $content[$key] = $this->gutenbergBlockHelper->replacePostTranslateBlockContent($value, $value, $submission);
     93                    $entityStrings[$key] = $this->gutenbergBlockHelper->replacePostTranslateBlockContent($value, $value, $submission);
    9194                }
    9295            }
    93             $content = apply_filters(ExportedAPI::FILTER_BEFORE_CLONE_CONTENT_WRITTEN, $content, $submission);
    94             $this->getContentHelper()->writeTargetContent($submission, $entity->fromArray($content));
    95 
    96             $metadata = [];
     96            $entityStrings = apply_filters(ExportedAPI::FILTER_BEFORE_CLONE_CONTENT_WRITTEN, $entityStrings, $submission);
     97            $this->getContentHelper()->writeTargetContent($submission, $entity->fromArray($entityStrings));
     98
     99            $metadata = $content['meta'];
    97100            foreach ($lockedFields['meta'] as $key => $value) {
    98101                $metadata[$key] = $value;
  • smartling-connector/trunk/inc/Smartling/ContentTypes/ExternalContentElementor.php

    r3333320 r3340860  
    2626    use LoggerSafeTrait;
    2727
    28     protected const META_FIELD_NAME = '_elementor_data';
     28    public const META_FIELD_NAME = '_elementor_data';
    2929    private const META_CONDITIONS_NAME = '_elementor_conditions';
    3030
  • smartling-connector/trunk/inc/Smartling/Models/RelatedContentInfo.php

    r3096059 r3340860  
    6565    {
    6666        $result = clone $this;
    67         $result->info[$containerId] = array_merge($result->info[$containerId] ?? [], $info->info);
     67        $result->info[$containerId] = $this->arrayMergePreserveKeys($this->info, $info->info);
    6868
    6969        return $result;
     70    }
     71
     72    /**
     73     * Elementor sometimes generates ids as numerical strings e.g. "12345678"
     74     * array_merge and array_merge_recursive don't preserve numerical keys
     75    */
     76    private function arrayMergePreserveKeys(array $array1, array $array2): array
     77    {
     78        foreach ($array2 as $key => $value) {
     79            if (is_array($value) && isset($array1[$key]) && is_array($array1[$key])) {
     80                $array1[$key] = $this->arrayMergePreserveKeys($array1[$key], $value);
     81            } else {
     82                $array1[$key] = $value;
     83            }
     84        }
     85        return $array1;
    7086    }
    7187
  • smartling-connector/trunk/inc/Smartling/WP/Table/QueueManagerTableWidget.php

    r3333320 r3340860  
    176176    }
    177177
    178     private function getCheckStatusCronActionCell(ConfigurationProfileEntity $profile, int $count): string
     178    private function getCheckStatusCronActionCell(?ConfigurationProfileEntity $profile, int $count): string
    179179    {
    180180        if ($count === 0) {
  • smartling-connector/trunk/readme.txt

    r3338937 r3340860  
    55Tested up to: 6.6.2
    66Requires PHP: 8.0
    7 Stable tag: 4.2.0
     7Stable tag: 4.3.0
    88License: GPLv2 or later
    99
     
    6363
    6464== Changelog ==
     65= 4.3.0 =
     66* Cloning should now handle relations for supported external plugins
     67* Added support for Elementor social icons widget
     68* Fixed issue where supported elementor content was partially translated
     69* Fixed fatal error on the Settings page when no configuration profiles are present
     70
    6571= 4.2.0 =
    6672* Fixed cloned items having the same guid field
  • smartling-connector/trunk/smartling-connector.php

    r3338937 r3340860  
    1212 * Plugin URI:        https://www.smartling.com/products/automate/integrations/wordpress/
    1313 * Description:       Integrate your WordPress site with Smartling to upload your content and download translations.
    14  * Version:           4.2.0
     14 * Version:           4.3.0
    1515 * Author:            Smartling
    1616 * Author URI:        https://www.smartling.com
Note: See TracChangeset for help on using the changeset viewer.