dvd74 Posted February 17, 2024 Share Posted February 17, 2024 Ciao a tutti, ho bisogno del vostro aiuto. Dopo aver aggiornato il mio sito a PS 8.1.3 ricevo il seguente errore quando vado ad editare un ordine nel backoffice: Quote Compile Error: Declaration of State::getStatesByIdCountry($idCountry, $active = false) must be compatible with StateCore::getStatesByIdCountry($idCountry, $active = false, $orderBy = null, $sort = 'ASC') in override/classes/State.php (line 32) /** * Class StateCore. */ class State extends StateCore { public static function getStatesByIdCountry($idCountry, $active = false) (linea 32) { if (empty($idCountry)) { die(Tools::displayError()); } Expand Link to comment Share on other sites More sharing options...
fedesib Posted February 19, 2024 Share Posted February 19, 2024 Ciao, dall'errore si capisce che è stato fatto un override della classe State.php e la funzione di cui è stato fatto l'override (getStatesByIdCountry) non risulta compatibile con la nuova versione di PS. In genere gli override vengono fatti da un modulo, quindi come prima cosa dovresti individuare il modulo che ha fatto l'override, se c'è un aggiornamento del modulo probabilmente questo errore è stato sistemato, altrimenti prova a chiedere allo sviluppatore. Buona giornata, Federica Link to comment Share on other sites More sharing options...
dvd74 Posted February 19, 2024 Author Share Posted February 19, 2024 Ciao, come posso fare per capire quale modulo ha fatto l'override se nel file non c'è il riferimento al modulo che lo ha creato? <?php /** * 2007-2018 PrestaShop. * * NOTICE OF LICENSE * * This source file is subject to the Open Software License (OSL 3.0) * that is bundled with this package in the file LICENSE.txt. * It is also available through the world-wide-web at this URL: * https://opensource.org/licenses/OSL-3.0 * If you did not receive a copy of the license and are unable to * obtain it through the world-wide-web, please send an email * to license@prestashop.com so we can send you a copy immediately. * * DISCLAIMER * * Do not edit or add to this file if you wish to upgrade PrestaShop to newer * versions in the future. If you wish to customize PrestaShop for your * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA <contact@prestashop.com> * @copyright 2007-2018 PrestaShop SA * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * International Registered Trademark & Property of PrestaShop SA */ /** * Class StateCore. */ class State extends StateCore { public static function getStatesByIdCountry($idCountry, $active = false) { if (empty($idCountry)) { die(Tools::displayError()); } return Db::getInstance()->executeS(' SELECT * FROM `' . _DB_PREFIX_ . 'state` s WHERE s.`id_country` = ' . (int) $idCountry . ($active ? ' AND s.active = 1' : ''). ' ORDER BY s.`name`' ); } } Link to comment Share on other sites More sharing options...
Fabry Posted February 19, 2024 Share Posted February 19, 2024 parte mancante nell'override che invece é presente nel core 🙂 $orderBy = null, $sort = 'ASC' per tanto modifica l'override cosi: public static function getStatesByIdCountry($idCountry, $active = false, $orderBy = null, $sort = 'ASC') ...tutto il resto rimane identico poi dopo andrai a cercarti il modulo e modificherai l'override dentro al modulo altrimenti perdi la modifica nel caso aggiorni il modulo sy Link to comment Share on other sites More sharing options...
Codencode Posted February 20, 2024 Share Posted February 20, 2024 (edited) Molto probabilmente si tratta di un override fatto "a mano". In caso di override da parte di un modulo, prima del nome del metodo ci sarebbe un commento che indica quale modulo ha creato l'override e in che data è stato installato l'override. Edited February 20, 2024 by Codencode (see edit history) Link to comment Share on other sites More sharing options...
dvd74 Posted March 1, 2024 Author Share Posted March 1, 2024 Ciao Farby, grazie mille adesso funziona. Grazie anche a Codencode per le spigazioni Link to comment Share on other sites More sharing options...
Fabry Posted March 1, 2024 Share Posted March 1, 2024 On 3/1/2024 at 8:02 AM, dvd74 said: Ciao Farby, grazie mille adesso funziona. Grazie anche a Codencode per le spigazioni Expand 👍 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now