errore aggiornamento a 2.0.18

Aperto da Filippo, Lunedì - 03 Gennaio 2022 - 13:12

0 Utenti e 1 Visitatore stanno visualizzando questa discussione.

Filippo

due errori
./Sources/ManageSmileys.php
'function' => create_function('$rowData', '
global $txt;

if (empty($rowData[\'hidden\']))
return $txt[\'smileys_location_form\'];
elseif ($rowData[\'hidden\'] == 1)
return $txt[\'smileys_location_hidden\'];
else
return $txt[\'smileys_location_popup\'];
'),
'class' => 'windowbg',
),

con

'function' => function($rowData) use ($txt)
{
if (empty($rowData['hidden']))
return $txt['smileys_location_form'];
elseif ($rowData['hidden'] == 1)
return $txt['smileys_location_hidden'];
else
return $txt['smileys_location_popup'];
},
'class' => 'windowbg',
),


e ./Sources/Profile-Modify.php

'preload' => create_function('', '
global $smcFunc, $context, $cur_profile, $txt;

$request = $smcFunc[\'db_query\'](\'\', \'
SELECT value
FROM {db_prefix}themes
WHERE id_theme = {int:id_theme}
AND variable = {string:variable}
LIMIT 1\', array(
\'id_theme\' => $cur_profile[\'id_theme\'],
\'variable\' => \'name\',
)
);
list ($name) = $smcFunc[\'db_fetch_row\']($request);
$smcFunc[\'db_free_result\']($request);

$context[\'member\'][\'theme\'] = array(
\'id\' => $cur_profile[\'id_theme\'],
\'name\' => empty($cur_profile[\'id_theme\']) ? $txt[\'theme_forum_default\'] : $name
);
return true;
'),
'input_validate' => create_function('&$value', '
$value = (int) $value;
return true;
'),
),
'karma_good' => array(
'type' => 'callback',
'callback_func' => 'karma_modify',
'permission' => 'admin_forum',
// Set karma_bad too!
'input_validate' => create_function('&$value', '
global $profile_vars, $cur_profile;

$value = (int) $value;
if (isset($_POST[\'karma_bad\']))
{
$profile_vars[\'karma_bad\'] = $_POST[\'karma_bad\'] != \'\' ? (int) $_POST[\'karma_bad\'] : 0;
$cur_profile[\'karma_bad\'] = $_POST[\'karma_bad\'] != \'\' ? (int) $_POST[\'karma_bad\'] : 0;
}
return true;
'),
'preload' => create_function('', '
global $context, $cur_profile;

$context[\'member\'][\'karma\'][\'good\'] = $cur_profile[\'karma_good\'];
$context[\'member\'][\'karma\'][\'bad\'] = $cur_profile[\'karma_bad\'];

return true;
'),
'enabled' => !empty($modSettings['karmaMode']),
),


con

'preload' => function() use ($smcFunc, &$context, $cur_profile, $txt)
{
$request = $smcFunc['db_query']('', '
SELECT value
FROM {db_prefix}themes
WHERE id_theme = {int:id_theme}
AND variable = {string:variable}
LIMIT 1', array(
'id_theme' => $cur_profile['id_theme'],
'variable' => 'name',
)
);
list ($name) = $smcFunc['db_fetch_row']($request);
$smcFunc['db_free_result']($request);

$context['member']['theme'] = array(
'id' => $cur_profile['id_theme'],
'name' => empty($cur_profile['id_theme']) ? $txt['theme_forum_default'] : $name
);
return true;
},
'input_validate' => function(&$value)
{
$value = (int) $value;
return true;
},
),
'karma_good' => array(
'type' => 'callback',
'callback_func' => 'karma_modify',
'permission' => 'admin_forum',
// Set karma_bad too!
'input_validate' => function(&$value)
{
global $profile_vars, $cur_profile;

$value = (int) $value;
if (isset($_POST['karma_bad']))
{
$profile_vars['karma_bad'] = $_POST['karma_bad'] != '' ? (int) $_POST['karma_bad'] : 0;
$cur_profile['karma_bad'] = $_POST['karma_bad'] != '' ? (int) $_POST['karma_bad'] : 0;
}
return true;
},
'preload' => function()
{
global $context, $cur_profile;

$context['member']['karma']['good'] = $cur_profile['karma_good'];
$context['member']['karma']['bad'] = $cur_profile['karma_bad'];

return true;
},
'enabled' => !empty($modSettings['karmaMode']),
),



Darknico

Detto così aiuta poco, intendi che ti da errore quando cerca di fare il replace di quelle 2 parti?

Allega i 2 file incriminati, senza non è facile capire perchè da errore :)
Non supporto privatamente, non risponderei e ci rimarreste male....

Filippo

#2
Infatti li stavo esaminando.
La prima differenza è qui, c'è in più  $modSettings;

'function' => create_function('$rowData', '
global $txt, $modSettings;

if (empty($rowData[\'hidden\']))
return $txt[\'smileys_location_form\'];
elseif ($rowData[\'hidden\'] == 1)
return $txt[\'smileys_location_hidden\'];
else
return $txt[\'smileys_location_popup\'] . \' (\' . $txt[\'tabbed_smileys_tab\']. \': \' . (!empty($modSettings[\'tabbed_smileys\'][\'popup\'][$rowData[\'smiley_row\']+1]) ? $modSettings[\'tabbed_smileys\'][\'popup\'][$rowData[\'smiley_row\']+1] : ($txt[\'additional_smileys\'] . \' \' . $rowData[\'smiley_row\']+1)) . \')\';
'),
'class' => 'windowbg',
),

Darknico

Applica la mod e poi fai queste 2 modifiche:

./Sources/ManageSmileys.php

Da:
'function' => create_function('$rowData', '
global $txt, $modSettings;

if (empty($rowData[\'hidden\']))
return $txt[\'smileys_location_form\'];
elseif ($rowData[\'hidden\'] == 1)
return $txt[\'smileys_location_hidden\'];
else
return $txt[\'smileys_location_popup\'] . \' (\' . $txt[\'tabbed_smileys_tab\']. \': \' . (!empty($modSettings[\'tabbed_smileys\'][\'popup\'][$rowData[\'smiley_row\']+1]) ? $modSettings[\'tabbed_smileys\'][\'popup\'][$rowData[\'smiley_row\']+1] : ($txt[\'additional_smileys\'] . \' \' . $rowData[\'smiley_row\']+1)) . \')\';
'),
'class' => 'windowbg',
),


a:
'function' => function($rowData) use ($txt, $modSettings)
{
if (empty($rowData['hidden']))
return $txt['smileys_location_form'];
elseif ($rowData['hidden'] == 1)
return $txt['smileys_location_hidden'];
else
return $txt['smileys_location_popup'];
},
'class' => 'windowbg',
),



./Sources/Profile-Modify.php

Da:
'preload' => create_function('', '
global $smcFunc, $context, $cur_profile, $txt;

$request = $smcFunc[\'db_query\'](\'\', \'
SELECT value
FROM {db_prefix}themes
WHERE id_theme = {int:id_theme}
AND variable = {string:variable}
LIMIT 1\', array(
\'id_theme\' => $cur_profile[\'id_theme\'],
\'variable\' => \'name\',
)
);
list ($name) = $smcFunc[\'db_fetch_row\']($request);
$smcFunc[\'db_free_result\']($request);

$context[\'member\'][\'theme\'] = array(
\'id\' => $cur_profile[\'id_theme\'],
\'name\' => empty($cur_profile[\'id_theme\']) ? $txt[\'theme_forum_default\'] : $name
);
return true;
'),
'input_validate' => create_function('&$value', '
$value = (int) $value;
return true;
'),
),
'latitude' => array(
'type' => 'callback',
'callback_func' => 'googlemap_modify',
'permission' => 'googleMap_place',
'input_validate' => create_function('&$value', '
global $profile_vars, $cur_profile;

// set latitude to a float value
$value = (float) $value;

// fix up longitude as well
$profile_vars[\'longitude\'] = !empty($_POST[\'longitude\']) ? (float) $_POST[\'longitude\'] : 0;
$cur_profile[\'longitude\'] = !empty($_POST[\'longitude\']) ? (float) $_POST[\'longitude\'] : 0;

// now is a good time for the pin date ;)
$pintime = time();
$profile_vars[\'pindate\'] = (int) $pintime;
$cur_profile[\'pindate\'] = (int) $pintime;

return true;
'),
'preload' => create_function('', '
global $context, $cur_profile;

$context[\'member\'][\'googleMap\'][\'latitude\'] = (float) $cur_profile[\'latitude\'];
$context[\'member\'][\'googleMap\'][\'longitude\'] = (float) $cur_profile[\'longitude\'];
$context[\'member\'][\'googleMap\'][\'pindate\'] = $cur_profile[\'pindate\'];

return true;
'),
),
'karma_good' => array(
'type' => 'callback',
'callback_func' => 'karma_modify',
'permission' => 'admin_forum',
// Set karma_bad too!
'input_validate' => create_function('&$value', '
global $profile_vars, $cur_profile;

$value = (int) $value;
if (isset($_POST[\'karma_bad\']))
{
$profile_vars[\'karma_bad\'] = $_POST[\'karma_bad\'] != \'\' ? (int) $_POST[\'karma_bad\'] : 0;
$cur_profile[\'karma_bad\'] = $_POST[\'karma_bad\'] != \'\' ? (int) $_POST[\'karma_bad\'] : 0;
}
return true;
'),
'preload' => create_function('', '
global $context, $cur_profile;

$context[\'member\'][\'karma\'][\'good\'] = $cur_profile[\'karma_good\'];
$context[\'member\'][\'karma\'][\'bad\'] = $cur_profile[\'karma_bad\'];

return true;
'),
'enabled' => !empty($modSettings['karmaMode']),
),


a:
'preload' => function() use ($smcFunc, &$context, $cur_profile, $txt)
{
$request = $smcFunc['db_query']('', '
SELECT value
FROM {db_prefix}themes
WHERE id_theme = {int:id_theme}
AND variable = {string:variable}
LIMIT 1', array(
'id_theme' => $cur_profile['id_theme'],
'variable' => 'name',
)
);
list ($name) = $smcFunc['db_fetch_row']($request);
$smcFunc['db_free_result']($request);

$context['member']['theme'] = array(
'id' => $cur_profile['id_theme'],
'name' => empty($cur_profile['id_theme']) ? $txt['theme_forum_default'] : $name
);
return true;
},
'input_validate' => function(&$value)
{
$value = (int) $value;
return true;
},
),
'karma_good' => array(
'type' => 'callback',
'callback_func' => 'karma_modify',
'permission' => 'admin_forum',
// Set karma_bad too!
'input_validate' => function(&$value)
{
global $profile_vars, $cur_profile;

$value = (int) $value;
if (isset($_POST['karma_bad']))
{
$profile_vars['karma_bad'] = $_POST['karma_bad'] != '' ? (int) $_POST['karma_bad'] : 0;
$cur_profile['karma_bad'] = $_POST['karma_bad'] != '' ? (int) $_POST['karma_bad'] : 0;
}
return true;
},
'preload' => function()
{
global $context, $cur_profile;

$context['member']['karma']['good'] = $cur_profile['karma_good'];
$context['member']['karma']['bad'] = $cur_profile['karma_bad'];

return true;
},
'enabled' => !empty($modSettings['karmaMode']),
),
'latitude' => array(
'type' => 'callback',
'callback_func' => 'googlemap_modify',
'permission' => 'googleMap_place',
'input_validate' => create_function('&$value', '
global $profile_vars, $cur_profile;

// set latitude to a float value
$value = (float) $value;

// fix up longitude as well
$profile_vars[\'longitude\'] = !empty($_POST[\'longitude\']) ? (float) $_POST[\'longitude\'] : 0;
$cur_profile[\'longitude\'] = !empty($_POST[\'longitude\']) ? (float) $_POST[\'longitude\'] : 0;

// now is a good time for the pin date ;)
$pintime = time();
$profile_vars[\'pindate\'] = (int) $pintime;
$cur_profile[\'pindate\'] = (int) $pintime;

return true;
'),
'preload' => create_function('', '
global $context, $cur_profile;

$context[\'member\'][\'googleMap\'][\'latitude\'] = (float) $cur_profile[\'latitude\'];
$context[\'member\'][\'googleMap\'][\'longitude\'] = (float) $cur_profile[\'longitude\'];
$context[\'member\'][\'googleMap\'][\'pindate\'] = $cur_profile[\'pindate\'];

return true;
'),
),



Mi raccomando, un bel backup di tutto!
Non supporto privatamente, non risponderei e ci rimarreste male....

Filippo


Darknico

Citazione di: Filippo il Lunedì - 03 Gennaio 2022 - 14:43
backup di Sources e...

index.php
SSI.php
Sources
Themes

ovvero, dove sta modificando ;)
In casi di problemi, ripristini e torna magicamente indietro
Non supporto privatamente, non risponderei e ci rimarreste male....

Filippo

Citazione di: Darknico il Lunedì - 03 Gennaio 2022 - 14:47
Citazione di: Filippo il Lunedì - 03 Gennaio 2022 - 14:43
backup di Sources e...

index.php
SSI.php
Sources
Themes

ovvero, dove sta modificando ;)
In casi di problemi, ripristini e torna magicamente indietro

Tanto per essere completamente esaustivi, anche a future visite  ;D

Darknico

Citazione di: Filippo il Lunedì - 03 Gennaio 2022 - 14:51
Tanto per essere completamente esaustivi, anche a future visite  ;D

eh no, una volta applicato la patch e tutto funziona come si deve, quel backup non puoi più usarlo per il prossimo upgrade alle 2.0.19, altrimenti torni alle 2.0.17 :D
Non supporto privatamente, non risponderei e ci rimarreste male....

Filippo

mi riferivo ad un qualsiasi utente col medesimo problema che visitava questo forum

Darknico

Citazione di: Filippo il Lunedì - 03 Gennaio 2022 - 15:08
mi riferivo ad un qualsiasi utente col medesimo problema che visitava questo forum


Giusto!

fammi sapere, se tutto va bene puoi anche già applicare la patch per 2.0.19
Non supporto privatamente, non risponderei e ci rimarreste male....

Filippo


Discussioni simili (3)