Nocebo Posted October 21, 2017 Share Posted October 21, 2017 Hello, I'm trying to pass my module to the validator, but I have this error: I do not know how to fix it. thank you in advance Link to comment Share on other sites More sharing options...
razaro Posted October 21, 2017 Share Posted October 21, 2017 Short array syntax is this [] , you should use array() . And do not think that modules that comes with PrestaShop would pass validator, even that they use short syntax Link to comment Share on other sites More sharing options...
Nocebo Posted October 21, 2017 Author Share Posted October 21, 2017 Thank you for your help. I know that the original modules do not pass the validator, but I use it as a starting point Link to comment Share on other sites More sharing options...
Nocebo Posted October 22, 2017 Author Share Posted October 22, 2017 When I do this the module does not install anymore ['media' => 'all', 'priority' => 150] ('media' => 'all', 'priority' => 150) Link to comment Share on other sites More sharing options...
razaro Posted October 22, 2017 Share Posted October 22, 2017 well this ['media' => 'all', 'priority' => 150] should be array('media' => 'all', 'priority' => 150) so [] equal to array(), not () Link to comment Share on other sites More sharing options...
Nocebo Posted October 22, 2017 Author Share Posted October 22, 2017 Thank you for your answer. I'm abusing asking you for this public·function·renderWidget($hookName·=·null,·array·$configuration·=·[]) Link to comment Share on other sites More sharing options...
razaro Posted October 22, 2017 Share Posted October 22, 2017 This should work public function renderWidget($hookName, array $configuration) Link to comment Share on other sites More sharing options...
Nocebo Posted October 22, 2017 Author Share Posted October 22, 2017 Thank a lot for your help. I have almost finished all the transformation of the module and the correction Unused function parameter $hookName. Unused function parameter $configuration. ··public·function·getWidgetVariables($hookName,·array·$configuration) But if I remove it the module does not install anymore Link to comment Share on other sites More sharing options...
razaro Posted October 22, 2017 Share Posted October 22, 2017 You can add them as variables and passed it to return, even if you do not use them later. Or just leave it like that and point to Addons validation team you will not use them and have that warnings. And to test module after validation fully. Link to comment Share on other sites More sharing options...
Nocebo Posted October 22, 2017 Author Share Posted October 22, 2017 Thank you for your answer, I do not think the validation team accepts a module with errors, even if there is a little. Link to comment Share on other sites More sharing options...
razaro Posted October 22, 2017 Share Posted October 22, 2017 Good luck with validation and hope you get lot of sales. Link to comment Share on other sites More sharing options...
Nocebo Posted October 22, 2017 Author Share Posted October 22, 2017 Thank you very much for your truly valuable help Link to comment Share on other sites More sharing options...
Nocebo Posted November 13, 2017 Author Share Posted November 13, 2017 (edited) Hello everyone, I tried to validate my module but impossible with this : public function headerHTML() { if (Tools::getValue('controller') != 'AdminModules' && Tools::getValue('configure') != $this->name) { return; } $this->context->controller->addJqueryUI('ui.sortable'); /* Style & js for fieldset 'slides configuration' */ $html = '<script type="text/javascript"> $(function() { var $mySlides = $("#slides"); $mySlides.sortable({ opacity: 0.6, cursor: "move", update: function() { var order = $(this).sortable("serialize") + "&action=updateSlidesPosition"; $.post("'.$this->context->shop->physical_uri.$this->context->shop->virtual_uri.'modules/'.$this->name.'/ajax_'.$this->name.'.php?secure_key='.$this->secure_key.'", order); } }); $mySlides.hover(function() { $(this).css("cursor","move"); }, function() { $(this).css("cursor","auto"); }); }); </script>'; return $html; } I try to play java in a tpl or js, but this is not interpreted Thank for your help Edited November 14, 2017 by Nocebo (see edit history) Link to comment Share on other sites More sharing options...
Nocebo Posted January 30, 2018 Author Share Posted January 30, 2018 Hello, I still have validation problems PayFooter :: delete () && PayFooter :: delete1 () you must check the destination directory of the deleted file I dont understand. 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