Closed (fixed)
Project:
Alexa
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
17 Feb 2017 at 13:44 UTC
Updated:
8 Aug 2017 at 22:35 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
gambryComment #3
gambryI forgot to mention I'm happy to suggest a patch, if you like the idea.
Comment #4
samuel.seide commentedI think a local dev mode is a good idea. It's not good practice to continually push code up to production just to test if it's working. Though it appears the call is no longer being made in Drupal\alexa\Controller\AlexaCachedCertificate and is now being done inside AlexaEndpointController.php starting on line 63.
Comment #5
gambryLet's make some progress.
Adding a Development mode checkbox on configuration form, driven by the State API so it can have per-environment values.
Checking the checkbox set the switch alexa.dev_mode TRUE so the
Alexa\Request\Certificate::validateRequest()is skipped.@samuel.seide I'm on 8.x-1.x and the call is still as per IS details.
Comment #6
hampercm commentedThanks for the patch! Good call on using the State API for this :)
There's one typo in your patch, which I'll just fix on commit.
Comment #8
hampercm commentedComment #9
hampercm commentedPatch ported to D7
Comment #10
gambryAs we are changing this bit, we can wrap the text with t() to facilitate translators life.
Is this change related to this issue?
I haven't done any manual test.
Comment #11
hampercm commentedThanks for the review! Re #10:
1) Explicit use of t() in hook_menu is not necessary. See "title" and "description" in https://api.drupal.org/api/drupal/modules%21system%21system.api.php/func...
2) No, that's a separate fix that got included by mistake. Removed.
I have manually tested this, but a second manual test would be ideal.
Comment #12
hampercm commentedComment #13
gambryI get two Notices:
Should we check if Dev mode is ON or wrapping those 2 line with
isset()?Besides I haven't managed to get the library loading in D7.
I'll try building the codebase completely using composer and check again.
Comment #14
hampercm commented@gambry thanks for the review. I'll fix those PHP notices.
The D7 module can use Composer Manager to install its dependencies. If you have it installed and enabled before you install the Alexa module, it will take care of importing the library automatically.
Comment #15
gambry@hampercm I was using Composer Manager, without luck. Just for the sake of testing this issue I've also included manually composer autoload.php, again without luck. I'll try again with next review.
Comment #17
hampercm commentedFixed the log messages regarding unset array values, and committed. Thanks for the review and testing, @gambry