Skip to content

Commit

Permalink
Merge pull request #8 from pbs/develop
Browse files Browse the repository at this point in the history
v4.0.3.4
  • Loading branch information
andrewmenich authored Jun 3, 2024
2 parents 208c502 + 4a88ced commit 58d726b
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 10 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## 4.0.3.4 - 2024-06-03

### Fixed
- Show sync Switch had an unbroken `case` resulting in invalid data
- POST body data was not correctly getting sent in Synchronize action requests

## 4.0.3.3 - 2024-06-03

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "moon/pbs-media-manager-craft-plugin-food",
"description": "Media Manager 4 for PBS API",
"version": "4.0.3.3",
"version": "4.0.3.4",
"type": "craft-plugin",
"keywords": ["craftcms", "pbs", "media-manager"],
"license": "MIT",
Expand Down
7 changes: 3 additions & 4 deletions src/assetbundles/synchronizecpsection/dist/js/Synchronize.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@

$('#synchronize-single-button').addClass('disabled');

Craft.sendActionRequest('POST', 'mediamanager/synchronize/synchronize-single', { data })
Craft.sendActionRequest('POST', 'mediamanager/synchronize/synchronize-single', { data: data })
.then((response) => {
if (response.data.success) {
Craft.cp.displayNotice(Craft.t('mediamanager', 'Synchronize started.'));
Expand Down Expand Up @@ -183,7 +183,7 @@
fieldsToSync: fieldsToSync,
};

Craft.sendActionRequest('POST', 'mediamanager/synchronize/synchronize-all', data)
Craft.sendActionRequest('POST', 'mediamanager/synchronize/synchronize-all', { data: data})
.then((response) => {
if (response.data.success) {
Craft.cp.displayNotice(Craft.t('mediamanager', 'Synchronize for all show started.'));
Expand Down Expand Up @@ -214,8 +214,7 @@
var data = {
fieldsToSync: fieldsToSync,
};

Craft.sendActionRequest('POST', 'mediamanager/synchronize/synchronize-show-entries', data)
Craft.sendActionRequest('POST', 'mediamanager/synchronize/synchronize-show-entries', {data: data})
.then((response) => {
if (response.data.success) {
Craft.cp.displayNotice(Craft.t('mediamanager', 'Synchronize for show entries started.'));
Expand Down
2 changes: 1 addition & 1 deletion src/controllers/SynchronizeController.php
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ public function actionSynchronizeShowEntries()
]);
}

$fieldsToSync = $request->getBodyParam('fieldsToSync');
$fieldsToSync = $request->getBodyParam('fieldsToSync', []);

$synchronize = MediaManager::getInstance()->api->synchronizeShowEntries( $validatedShows, $fieldsToSync);

Expand Down
10 changes: 6 additions & 4 deletions src/jobs/ShowEntriesSync.php
Original file line number Diff line number Diff line change
Expand Up @@ -323,11 +323,13 @@ public function execute( $queue ): void

break;

case 'slug':
case 'slug':

if(isset($showAttributes->slug)){
$defaultFields[SynchronizeHelper::getApiField($apiField, 'showApiColumnFields')] = $showAttributes->slug;
}
if(isset($showAttributes->slug)){
$defaultFields[SynchronizeHelper::getApiField($apiField, 'showApiColumnFields')] = $showAttributes->slug;
}

break;

case 'premiered_on':
if( $showAttributes->premiered_on != null) {
Expand Down

0 comments on commit 58d726b

Please sign in to comment.