MODULE_ID is required for some gadgets but it did not processed if token is 
invalid
-----------------------------------------------------------------------------------

                 Key: SHINDIG-1043
                 URL: https://issues.apache.org/jira/browse/SHINDIG-1043
             Project: Shindig
          Issue Type: Bug
          Components: PHP
    Affects Versions: trunk
            Reporter: Dmitry Vorobyev


My test token is invalid and extractAndValidateToken throws exception. But 
Config::get('render_token_required') == false and this exception ignored. In 
this case MODULE_ID do not processed and cause js error. 

I do such patch:
===================================================================
--- 
http://svn.apache.org/repos/asf/incubator/shindig/trunk/php/src/gadgets/GadgetFactory.php
   (revision 771267)
+++ 
http://svn.apache.org/repos/asf/incubator/shindig/trunk/php/src/gadgets/GadgetFactory.php
   (working copy)
@@ -119,6 +119,8 @@
     $gadget->substitutions = new Substitutions();
     if ($this->token) {
       $gadget->substitutions->addSubstitution('MODULE', "ID", 
$this->token->getModuleId());
+    } else {
+        $gadget->substitutions->addSubstitution('MODULE', "ID", 0);
     }
     if ($gadget->gadgetSpec->locales) {
       $gadget->substitutions->addSubstitutions('MSG', 
$gadget->gadgetSpec->locales);


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to