Plugin Directory

Changeset 3366226


Ignore:
Timestamp:
09/23/2025 06:15:25 AM (6 months ago)
Author:
smartling
Message:

Update to v 4.3.5

Location:
smartling-connector/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • smartling-connector/trunk/inc/Smartling/Extensions/Acf/AcfTypeDetector.php

    r3181441 r3366226  
    9797    {
    9898        if (false === $fieldKey = $this->getCache()->get($this->getCacheKeyByFieldName($fieldName))) {
    99             $_realFieldName = preg_replace('#^meta\/#ius', '', $fieldName);
     99            $matches = [];
     100            $_realFieldName = preg_match('#^(?:meta/)?([^/]+)#i', $fieldName, $matches) ? $matches[1] : $fieldName;
    100101            if (array_key_exists('_' . $_realFieldName, $metadata)) {
    101102                $fieldKey = $metadata['_' . $_realFieldName];
     
    109110    }
    110111
    111     private function getProcessorByFieldKey($key, $fieldName)
     112    public function getProcessorByFieldKey($key, $fieldName)
    112113    {
    113114        if (!array_key_exists($key, AcfDynamicSupport::$acfReverseDefinitionAction)) {
  • smartling-connector/trunk/inc/Smartling/Helpers/RelativeLinkedAttachmentCoreHelper.php

    r3126032 r3366226  
    7575    protected function processString(string|array &$stringValue): void
    7676    {
    77         $replacer = new PairReplacerHelper();
    78         $matches = [];
    79 
    8077        if (is_array($stringValue)) {
    8178            foreach ($stringValue as &$value) {
     
    8481            return;
    8582        }
     83
     84        $replacer = new PairReplacerHelper();
     85        $matches = [];
    8686
    8787        if (0 < preg_match_all(self::ACF_GUTENBERG_BLOCK, $stringValue, $matches)) {
  • smartling-connector/trunk/inc/Smartling/Services/ContentRelationsDiscoveryService.php

    r3352527 r3366226  
    2727use Smartling\Helpers\GutenbergBlockHelper;
    2828use Smartling\Helpers\LoggerSafeTrait;
     29use Smartling\Helpers\MetaFieldProcessor\BulkProcessors\PostBasedProcessor;
    2930use Smartling\Helpers\MetaFieldProcessor\DefaultMetaFieldProcessor;
    3031use Smartling\Helpers\MetaFieldProcessor\MetaFieldProcessorAbstract;
     
    529530                }
    530531
    531                 /**
    532                  * If processor is detected
    533                  */
    534                 if ($processor instanceof MetaFieldProcessorAbstract && 0 !== (int)$fValue) {
     532                if ($processor instanceof PostBasedProcessor && is_array($this->wordpressProxy->maybe_unserialize($fValue))) {
     533                    $detectedReferences[self::POST_BASED_PROCESSOR][] = $this->wordpressProxy->maybe_unserialize($fValue);
     534                } elseif ($processor instanceof MetaFieldProcessorAbstract && 0 !== (int)$fValue) {
    535535                    $shortProcessorName = ArrayHelper::last(explode('\\', get_class($processor)));
    536536
     
    606606
    607607        if (isset($references[self::POST_BASED_PROCESSOR])) {
    608             foreach ($references[self::POST_BASED_PROCESSOR] as $postId) {
    609                 $postType = $this->wordpressProxy->get_post_type($postId);
    610                 if ($postType !== false) {
    611                     $result[$postType][] = $postId;
    612                 } else {
    613                     $this->getLogger()->warning("WordPress returned no post exist for detected reference postId=$postId");
     608            foreach ($references[self::POST_BASED_PROCESSOR] as $reference) {
     609                if (!is_array($reference)) {
     610                    $reference = [$reference];
     611                }
     612                foreach ($reference as $referenceId) {
     613                    if (!is_numeric($referenceId)) {
     614                        $this->getLogger()->warning("Got non-numeric reference postId=$referenceId, skipping");
     615                    }
     616                    $referenceId = (int)$referenceId;
     617                    $postType = $this->wordpressProxy->get_post_type($referenceId);
     618                    if ($postType !== false) {
     619                        $result[$postType][] = $referenceId;
     620                    } else {
     621                        $this->getLogger()->warning("WordPress returned no post exists for detected reference postId=$referenceId, skipping");
     622                    }
    614623                }
    615624            }
  • smartling-connector/trunk/readme.txt

    r3359747 r3366226  
    55Tested up to: 6.6.2
    66Requires PHP: 8.0
    7 Stable tag: 4.3.4
     7Stable tag: 4.3.5
    88License: GPLv2 or later
    99
     
    6363
    6464== Changelog ==
     65= 4.3.5 =
     66* Added support for ACF metafields that have multiple relations
     67
    6568= 4.3.4 =
    6669* Fixed issue where related ACF content was not detected when using the upload widget
  • smartling-connector/trunk/smartling-connector.php

    r3359747 r3366226  
    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.3.4
     14 * Version:           4.3.5
    1515 * Author:            Smartling
    1616 * Author URI:        https://www.smartling.com
Note: See TracChangeset for help on using the changeset viewer.