# |
Apr 19th 2017, 11:58 |
inoas |
;p |
# |
Apr 19th 2017, 11:58 |
inoas |
middleware... urgh |
# |
Apr 19th 2017, 11:58 |
inoas |
the check for what he can do can either be controller or model domain |
# |
Apr 19th 2017, 11:58 |
inoas |
obinoob: IMHO depends. The check for which user is operating clearly is controller space |
# |
Apr 19th 2017, 11:57 |
inoas |
add debug() on top of $this->addBehavior |
# |
Apr 19th 2017, 11:56 |
inoas |
and you have to make sure your model where you use addBehavior is actually being used |
# |
Apr 19th 2017, 11:56 |
inoas |
then this line is important use Muffin\Footprint\Auth\FootprintAwareTrait; |
# |
Apr 19th 2017, 11:56 |
hmic |
can be a middleware very well as of 3.4 :D |
# |
Apr 19th 2017, 11:56 |
inoas |
Junior: first of all setup foreign keys so that user_id cannot ever be 0 or NULL ;) - just in case muffin does not work you do not accidentially save data without user ids :p |
# |
Apr 19th 2017, 11:56 |
hmic |
"code that would allow" - thats authorization |
# |
Apr 19th 2017, 11:49 |
obinoob |
I have a small doubt about where should i put code that allows a user to view only his own data entries I suppose that kind of logic would go in model instead of controller? |
# |
Apr 19th 2017, 11:39 |
Junior |
my createdby is saved as 0 instead of the actual user id |
# |
Apr 19th 2017, 11:29 |
Junior |
i am using https://github.com/UseMuffin/Footprint and my user is not loaded, i have followed the docs, any ideeas why? |
# |
Apr 19th 2017, 11:13 |
inoas |
_setIsPublished right |
# |
Apr 19th 2017, 11:12 |
inoas |
in which mutator/accessor would that happen? |
# |
Apr 19th 2017, 11:11 |
inoas |
to save the state along |
# |
Apr 19th 2017, 11:11 |
inoas |
i want to set was_published to 1 in my entity |
# |
Apr 19th 2017, 11:11 |
inoas |
when is_published is set to 1 |
# |
Apr 19th 2017, 10:58 |
hmic |
that poor cobra-the-joker... 1.2 :DD |
# |
Apr 19th 2017, 10:54 |
hmic |
no, thats worong too :/ |
# |
Apr 19th 2017, 10:54 |
hmic |
so add after line 26 'order' => ['Users.name' => 'asc'] instead of line 31 |
# |
Apr 19th 2017, 10:53 |
hmic |
thats what i thought, you need to taret the correct one on its most outer scope, so on Holidays, not Days |
# |
Apr 19th 2017, 10:53 |
Neon1024 |
Time for a break :) |
# |
Apr 19th 2017, 10:53 |
Neon1024 |
Ah, it is two queries, that’s why! |
# |
Apr 19th 2017, 10:52 |
Neon1024 |
I get an SQL error because the table isn’t joined, it’s very strange |
# |
Apr 19th 2017, 10:52 |
Neon1024 |
But when you add in an 'Users.first_name' => 'asc' |
# |
Apr 19th 2017, 10:51 |
Neon1024 |
But if it’s joined I should be able order the query |
# |
Apr 19th 2017, 10:51 |
Neon1024 |
Might be because of this, INNER JOIN `users` `Users` ON `Users`.`id` = (`Holidays`.`user_id`) |
# |
Apr 19th 2017, 10:50 |
hmic |
however, i'm not sure if it has to do with your actual problem really. but maybe you try with just adding ->order() without contain/matching just to get a better idea where the error stems from |
# |
Apr 19th 2017, 10:49 |
hmic |
if($team) matching() else contain() |
# |
Apr 19th 2017, 10:49 |
Neon1024 |
I don’t display the team, so not much use containing it |
# |
Apr 19th 2017, 10:49 |
Neon1024 |
No, you’re right |
# |
Apr 19th 2017, 10:49 |
hmic |
as long as you do not use a different alias, it makes no sense to me |
# |
Apr 19th 2017, 10:48 |
Neon1024 |
It’s a holiday calendar :) |
# |
Apr 19th 2017, 10:48 |
hmic |
still an eigher or |
# |
Apr 19th 2017, 10:48 |
Neon1024 |
As I still want to show all the days |
# |
Apr 19th 2017, 10:48 |
Neon1024 |
So I can find all the days with users on holiday, who are in a certain team |
# |
Apr 19th 2017, 10:48 |
Neon1024 |
It’s conditional |
# |
Apr 19th 2017, 10:47 |
hmic |
it's an eigher/or, isn't it? |
# |
Apr 19th 2017, 10:47 |
hmic |
why do you contain and matching teams btw? |
# |
Apr 19th 2017, 10:47 |
hmic |
maybe the matching associated with it?! |