Changeset 3366226
- Timestamp:
- 09/23/2025 06:15:25 AM (6 months ago)
- Location:
- smartling-connector/trunk
- Files:
-
- 5 edited
-
inc/Smartling/Extensions/Acf/AcfTypeDetector.php (modified) (2 diffs)
-
inc/Smartling/Helpers/RelativeLinkedAttachmentCoreHelper.php (modified) (2 diffs)
-
inc/Smartling/Services/ContentRelationsDiscoveryService.php (modified) (3 diffs)
-
readme.txt (modified) (2 diffs)
-
smartling-connector.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
smartling-connector/trunk/inc/Smartling/Extensions/Acf/AcfTypeDetector.php
r3181441 r3366226 97 97 { 98 98 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; 100 101 if (array_key_exists('_' . $_realFieldName, $metadata)) { 101 102 $fieldKey = $metadata['_' . $_realFieldName]; … … 109 110 } 110 111 111 p rivatefunction getProcessorByFieldKey($key, $fieldName)112 public function getProcessorByFieldKey($key, $fieldName) 112 113 { 113 114 if (!array_key_exists($key, AcfDynamicSupport::$acfReverseDefinitionAction)) { -
smartling-connector/trunk/inc/Smartling/Helpers/RelativeLinkedAttachmentCoreHelper.php
r3126032 r3366226 75 75 protected function processString(string|array &$stringValue): void 76 76 { 77 $replacer = new PairReplacerHelper();78 $matches = [];79 80 77 if (is_array($stringValue)) { 81 78 foreach ($stringValue as &$value) { … … 84 81 return; 85 82 } 83 84 $replacer = new PairReplacerHelper(); 85 $matches = []; 86 86 87 87 if (0 < preg_match_all(self::ACF_GUTENBERG_BLOCK, $stringValue, $matches)) { -
smartling-connector/trunk/inc/Smartling/Services/ContentRelationsDiscoveryService.php
r3352527 r3366226 27 27 use Smartling\Helpers\GutenbergBlockHelper; 28 28 use Smartling\Helpers\LoggerSafeTrait; 29 use Smartling\Helpers\MetaFieldProcessor\BulkProcessors\PostBasedProcessor; 29 30 use Smartling\Helpers\MetaFieldProcessor\DefaultMetaFieldProcessor; 30 31 use Smartling\Helpers\MetaFieldProcessor\MetaFieldProcessorAbstract; … … 529 530 } 530 531 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) { 535 535 $shortProcessorName = ArrayHelper::last(explode('\\', get_class($processor))); 536 536 … … 606 606 607 607 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 } 614 623 } 615 624 } -
smartling-connector/trunk/readme.txt
r3359747 r3366226 5 5 Tested up to: 6.6.2 6 6 Requires PHP: 8.0 7 Stable tag: 4.3. 47 Stable tag: 4.3.5 8 8 License: GPLv2 or later 9 9 … … 63 63 64 64 == Changelog == 65 = 4.3.5 = 66 * Added support for ACF metafields that have multiple relations 67 65 68 = 4.3.4 = 66 69 * Fixed issue where related ACF content was not detected when using the upload widget -
smartling-connector/trunk/smartling-connector.php
r3359747 r3366226 12 12 * Plugin URI: https://www.smartling.com/products/automate/integrations/wordpress/ 13 13 * Description: Integrate your WordPress site with Smartling to upload your content and download translations. 14 * Version: 4.3. 414 * Version: 4.3.5 15 15 * Author: Smartling 16 16 * Author URI: https://www.smartling.com
Note: See TracChangeset
for help on using the changeset viewer.