Skip to content

Commit

Permalink
Fix Undefined index #126
Browse files Browse the repository at this point in the history
  • Loading branch information
xbgmsharp committed Jul 26, 2018
1 parent ec0dfc5 commit b9b4aa4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
1 change: 1 addition & 0 deletions admin/admin_batchmanager.php
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ function vjs_element_set_global_action($action, $collection)
'simulate' => false,
'batch_manager' => true,
);
// Merge default value with user configuration
$sync_options = array_merge(unserialize($conf['vjs_sync']), $sync_options_form);

// Do the work, share with batch manager
Expand Down
4 changes: 2 additions & 2 deletions admin/admin_photo.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,10 @@
'cat_id' => 0,
'subcats_included' => true,
);
// Override default value from configuration
// Merge default value with user configuration
if (isset($conf['vjs_sync']))
{
$sync_options = unserialize($conf['vjs_sync']);
$sync_options = array_merge(unserialize($conf['vjs_sync']), $sync_options);
}
// Do the Check dependencies, MediaInfo & FFMPEG, share with batch manager & photo edit & admin sync
require_once(dirname(__FILE__).'/../include/function_dependencies.php');
Expand Down
8 changes: 5 additions & 3 deletions admin/admin_sync.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,15 @@
'subcats_included' => true,
);

// Override default value from configuration
// Merge default value with user configuration
if (isset($conf['vjs_sync']))
{
$sync_options = unserialize($conf['vjs_sync']);
$sync_options = array_merge(unserialize($conf['vjs_sync']), $sync_options);
}

if(isset($_POST['mediainfo']) && isset($_POST['ffmpeg'])) {
// Override default value from the form
$sync_options = array(
$sync_options_form = array(
'mediainfo' => $_POST['mediainfo'],
'ffmpeg' => $_POST['ffmpeg'],
'exiftool' => $_POST['exiftool'],
Expand All @@ -74,6 +74,8 @@
'subcats_included' => isset($_POST['subcats_included']),
);

// Merge default value with user configuration
$sync_options = array_merge(unserialize($conf['vjs_sync']), $sync_options_form);
// Update config to DB
conf_update_param('vjs_sync', serialize($sync_options));
}
Expand Down

0 comments on commit b9b4aa4

Please sign in to comment.