# |
Jul 12th 2017, 15:51 |
jlroberts |
ohhh i just figured out what Mark Story was saying |
# |
Jul 12th 2017, 15:51 |
jlroberts |
and that is in composer.json |
# |
Jul 12th 2017, 15:50 |
jlroberts |
https://github.com/cakephp/cakephp/blob/master/composer.json |
# |
Jul 12th 2017, 15:50 |
jlroberts |
https://getcomposer.org/doc/04-schema.md#files |
# |
Jul 12th 2017, 15:50 |
ericadeefox |
it's worth noting again that using `session_start()` at the top of my first integration test prevents the plugin from throwing these exceptions. but also prevents my `$this->session()` setters from doing anything |
# |
Jul 12th 2017, 15:50 |
jlroberts |
https://stackoverflow.com/questions/24171078/composer-psr-how-to-autoload-functions |
# |
Jul 12th 2017, 15:50 |
jlroberts |
ok so, composer says, autoload functions.php like so |
# |
Jul 12th 2017, 15:49 |
ericadeefox |
https://github.com/facebook/php-graph-sdk/blob/4.0-dev/src/Facebook/FacebookRedirectLoginHelper.php head on over to ln 250 for storeState() and 270 for loadState() |
# |
Jul 12th 2017, 15:49 |
jarard01 |
jeremyharris, thanks that worked, I was using one of the other examples below |
# |
Jul 12th 2017, 15:48 |
jeremyharris |
I wonder what FB’s definition of active is here |
# |
Jul 12th 2017, 15:47 |
jeremyharris |
it’s active, you checked it in the controller |
# |
Jul 12th 2017, 15:47 |
jeremyharris |
@ericadeefox interesting. can you give me a link to the SDK, specifically where that exception is thrown? |
# |
Jul 12th 2017, 15:46 |
jeremyharris |
you need to use the “on” key |
# |
Jul 12th 2017, 15:46 |
jeremyharris |
jarard01 conditional validation here: https://book.cakephp.org/3.0/en/core-libraries/validation.html#conditional-validation |
# |
Jul 12th 2017, 15:46 |
ericadeefox |
means my session isn't active during these integration tests, which I knew, but I'm not sure what to do about it. |
# |
Jul 12th 2017, 15:46 |
jeremyharris |
jarard01 sorry the link is this: https://book.cakephp.org/3.0/en/core-libraries/validation.html#custom-validation-rules |
# |
Jul 12th 2017, 15:46 |
jarard01 |
but it still is |
# |
Jul 12th 2017, 15:45 |
jarard01 |
i tried retuning 'false' so that to test, the validation shouldn't ever be called |
# |
Jul 12th 2017, 15:45 |
ericadeefox |
oh, forgive me, it's a FacebookSDKException thrown: `Session not active, could not store state.` |
# |
Jul 12th 2017, 15:45 |
jeremyharris |
or you can always debug($context) to see exactly what it’s getting |
# |
Jul 12th 2017, 15:45 |
jeremyharris |
jarard01 then it’s probably not right :P have you checked the docs? they show what is in $context: https://book.cakephp.org/3.0/en/core-libraries/validation.html |
# |
Jul 12th 2017, 15:45 |
ericadeefox |
FacebookSDKException, it is. |
# |
Jul 12th 2017, 15:44 |
jarard01 |
jeremy no |
# |
Jul 12th 2017, 15:44 |
ericadeefox |
`Session not active, could not load state.` |
# |
Jul 12th 2017, 15:44 |
jeremyharris |
jarard01 does it work? |
# |
Jul 12th 2017, 15:44 |
ericadeefox |
let me go grab it for you... |
# |
Jul 12th 2017, 15:43 |
jeremyharris |
@ericadeefox I wonder if we’re looking at the right thing. do you know exactly what exception is being thrown by FB |
# |
Jul 12th 2017, 15:43 |
jarard01 |
does this look like a correct conditional validation rule: https://gist.github.com/spacebiscuit/ad07583634b8d732ad532e7f429477f3 |
# |
Jul 12th 2017, 15:43 |
ericadeefox |
returns `true` |
# |
Jul 12th 2017, 15:42 |
ericadeefox |
uhhhh |
# |
Jul 12th 2017, 15:41 |
ericadeefox |
oh, in the _controller_? my bad lol |
# |
Jul 12th 2017, 15:41 |
jeremyharris |
in the controller? |
# |
Jul 12th 2017, 15:41 |
ericadeefox |
it's gonna throw me an error saying that `$request` doesn't exist. |
# |
Jul 12th 2017, 15:41 |
jlroberts |
i dont understand what debug() has to do with it at this time... I just want to be able to use cake shells from the Installer.php, it makes sense, you load up a project with composer, and then immediately get into plugin migrations |
# |
Jul 12th 2017, 15:41 |
jeremyharris |
@ericadeefox if you throw a dd($this->request->session()->started())` on the top of one of your get actions, what does it show? |
# |
Jul 12th 2017, 15:40 |
jeremyharris |
maybe, but would you want to always use Cake\Functions\debug() to call global functions ? |
# |
Jul 12th 2017, 15:40 |
jlroberts |
ive read about autoloaders, there is specifically a spot for functions.php |
# |
Jul 12th 2017, 15:39 |
jeremyharris |
since the functions don’t exist within a namespace, the autoloader wouldn’t be able to find and thus require the file for you |
# |
Jul 12th 2017, 15:39 |
jlroberts |
heh |
# |
Jul 12th 2017, 15:39 |
jlroberts |
perfect, thats awesome, i think its supposed to autoload the functions.php file too though |
# |
Jul 12th 2017, 15:39 |
ericadeefox |
so. ok. doing a `$this->get()` or `$this->post()` request doesn't start a session, seemingly. I started each test with a `$this->get()` request and each of them still threw me 500s. hmm. |