Widget talk:CSS personnalisé
Aller à la navigation
Aller à la recherche
Smarty PHP errors[modifier]
- Problem
Got error 'PHP message: PHP Notice: Undefined index: js in /var/www/sites/gw2w-fr/extensions/Widgets/compiled_templates/b36b20f50231d64976b878f2471451493239beb3_0.wiki.CSS personnalis\xc3\xa9.php on line 27 PHP message: PHP Notice: Trying to get property 'value' of non-object in /var/www/sites/gw2w-fr/extensions/Widgets/compiled_templates/b36b20f50231d64976b878f2471451493239beb3_0.wiki.CSS personnalis\xc3\xa9.php on line 27', referer: [[Mini-super mineur choya]]
- Solution
Check if both the hash and css parameters have been set before trying to use them.
I've been lazy here and also replicated the javascript proofing recommended on the GW2W when an editor managed to use the custom CSS widget to show a javascript alert message.
<includeonly><!--{if isset($hash) && isset($css)}--><!--{if $hash=='72739eaabe767e401ab875b6301e805c5e847da8'}--><style type="text/css"><!--{$css|strip_tags:true}--></style><!--{else}--><strong>Direct use of this widget is prohibited. Use <a href="/wiki/Modèle:CSS_personnalisé" title="Modèle:CSS personnalisé">the Custom CSS template</a> instead.</strong><!--{/if}--><!--{else}-->The "hash" and "css" parameters are required for Modèle:CSS personnalisé.<!--{/if}--></includeonly>
-Chieftain Alex (discussion) 15 avril 2020 à 19:42 (CEST)