# |
Dec 11th 2017, 16:31 |
alex9 |
So, I believe that the $_SESSION is being used to access session data added through the saml plugin. There's some session renaming going on as well. |
# |
Dec 11th 2017, 16:31 |
hmic |
which is a good thing, as it prevents ppl from trying to do the wrong thing from the start - which is more changing session data than just accessing it |
# |
Dec 11th 2017, 16:30 |
hmic |
session handler does this: $_SESSION = null; after copying the data to the reqeust object |
# |
Dec 11th 2017, 16:30 |
alex9 |
When debug is turned off, I have no problem accessing the session |
# |
Dec 11th 2017, 16:29 |
hmic |
just use the $request, like you are supposed to |
# |
Dec 11th 2017, 16:29 |
neon1024 |
Heh, I bet if you didn’t access the session it wouldn’t be broken! ;) |
# |
Dec 11th 2017, 16:29 |
hmic |
alex9, you've got your solution already: you not only *should* not access the session, you just *cannot* |
# |
Dec 11th 2017, 16:29 |
alex9 |
Also, this only seems to be an issue when debug is on. When it's off, the session work fine. |
# |
Dec 11th 2017, 16:28 |
alex9 |
Hi! I'm having some problems. I'm using a plugin in my cakephp site, but when I try to access the sessions, I get the error "Undefined variable: _SESSION". Yes, I know I shouldn't be accessing it via $_SESSION, but it's an auth plugin that someone else wrote and I'm debugging. |
# |
Dec 11th 2017, 14:47 |
admad |
use TableRegistry::get(), for e.g. if you use $articles = TableRegistry::get('Articles') then it will use "articles" table of your db. Then you can use $articles->insert() as shown in the manual page i linked above |
# |
Dec 11th 2017, 14:42 |
cholthipaul |
specifically how do you set the table to insert in |
# |
Dec 11th 2017, 14:37 |
admad |
@cholthipaul https://github.com/cakephp/orm/ the read me shows how to setup connect and get table instance |
# |
Dec 11th 2017, 14:03 |
cholthipaul |
@admad in the context of cakephp/database as standalone lib, I dont see how to use the query builder to insert without orm |
# |
Dec 11th 2017, 13:50 |
admad |
@cholthipaul https://book.cakephp.org/3.0/en/orm/query-builder.html#inserting-data |
# |
Dec 11th 2017, 13:34 |
cholthipaul |
how to bulk insert using cakephp/database lib without orm |
# |
Dec 11th 2017, 13:33 |
jkpatel291289 |
when i debug($primary) in my models beforFind() it returns true even for associated entity. what should i do? |
# |
Dec 11th 2017, 11:49 |
willem |
https://book.cakephp.org/3.0/en/development/routing.html#matching-specific-http-methods |
# |
Dec 11th 2017, 11:48 |
willem |
ah, well, it seemed it was because of the *->post* in the route. I had to add * ‘_method’ => ‘post’ * to the Router::url call |
# |
Dec 11th 2017, 11:45 |
neon1024 |
As your controller prefix folder will be `V1` here |
# |
Dec 11th 2017, 11:45 |
neon1024 |
Could be case sensitive, perhaps it’s `'prefix' => 'api/V1'` |
# |
Dec 11th 2017, 11:24 |
willem |
This is not working: ``` [ 'controller' => 'Applicants', 'action' => 'add', 'prefix' => 'api/v1', ] ``` |
# |
Dec 11th 2017, 11:24 |
willem |
how do i build an url when using a sub-prefix? for example : ``` Router::prefix('api', function (RouteBuilder $routes) { $routes->prefix('v1', function (RouteBuilder $routes) { $routes->post('/vacancies', ['controller' => 'Vacancies', 'action' => 'add']); } } ``` |
# |
Dec 11th 2017, 11:17 |
slackebot |
!ask |
# |
Dec 11th 2017, 11:17 |
slackebot |
Command sent from Slack by saeideng: |
# |
Dec 11th 2017, 11:16 |
saeideng |
there is a ghost here just !ask |
# |
Dec 11th 2017, 11:16 |
jkpatel291289 |
@stoykovnet what should i write there? |
# |
Dec 11th 2017, 11:12 |
khushal |
anybody home ? |
# |
Dec 11th 2017, 11:11 |
khushal |
hi |
# |
Dec 11th 2017, 11:11 |
khushal |
nobody here ? |
# |
Dec 11th 2017, 11:11 |
khushal |
hey ? |
# |
Dec 11th 2017, 11:10 |
khushal |
is anybody here ? |
# |
Dec 11th 2017, 10:51 |
neon1024 |
I’ll wait for it to be fixed then I guess |
# |
Dec 11th 2017, 10:51 |
neon1024 |
Thanks saeideng! |
# |
Dec 11th 2017, 10:50 |
stoykovnet |
@jkpatel291289 In the gist u shared, i see no associations in the TrucksTable initialize method :thinking_face: |
# |
Dec 11th 2017, 10:48 |
saeideng |
https://github.com/cakephp/cakephp/issues/11514 |
# |
Dec 11th 2017, 10:48 |
saeideng |
https://github.com/cakephp/cakephp/pull/11518 |
# |
Dec 11th 2017, 10:48 |
saeideng |
https://github.com/cakephp/cakephp/pull/11462 @neon1024 |
# |
Dec 11th 2017, 10:34 |
jkpatel291289 |
@spriz no worries, thanks for your help |
# |
Dec 11th 2017, 10:34 |
spriz |
I’m unsure then, unfortunately @jkpatel291289 |
# |
Dec 11th 2017, 10:33 |
jkpatel291289 |
@spriz so whare is the problem.. i have updated gist with related files. Please check. |
# |
Dec 11th 2017, 10:33 |
neon1024 |
Downgraded back to 3.5.5 to fix it |