Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jul 07 2021 13:24
    dereuromark commented #46
  • Nov 09 2020 14:36
    jeffersonsimaogoncalves synchronize #46
  • Nov 09 2020 14:23
    jeffersonsimaogoncalves synchronize #46
  • Nov 09 2020 03:22
    jeffersonsimaogoncalves opened #46
  • Jul 05 2020 17:18
    Casmo commented #40
  • Jun 22 2020 14:04

    bobmulder on master

    Use 'fields' from CreatedBy or … (compare)

  • Jun 22 2020 14:04
    bobmulder closed #44
  • Jun 22 2020 12:59

    martonmiklos on master

    Fix null pointer exception in W… (compare)

  • Jun 22 2020 12:59
    martonmiklos closed #45
  • Jun 22 2020 09:18
    coveralls commented #44
  • Jun 22 2020 09:16
    bancer synchronize #44
  • Jun 22 2020 09:13
    coveralls commented #45
  • Jun 22 2020 09:11
    bancer opened #45
  • Jan 28 2020 15:32
    bobmulder commented #44
  • Jan 28 2020 10:14
    coveralls commented #44
  • Jan 28 2020 10:12
    bancer opened #44
  • Sep 19 2019 14:33
    martonmiklos closed #38
  • Sep 19 2019 14:33
    martonmiklos commented #38
  • Sep 19 2019 14:25
    martonmiklos closed #42
  • Sep 19 2019 14:25
    martonmiklos commented #42
Tomas Gonzalez
@Tomicapo

Hi, hope you enjoyed your holidays.

Let me show you an example:

  • I upload an image.
  • File path and name are stored in the entity. Ie: "uploads\static_pages\1\news-03.jpg" (notice the back slash "\" because of Windos OS).
  • When I want to display the image on the browser I have to change the back slash into a forward slash. Ie: domain.com/uploads/static_pages/1/news-03.jpg

So, whai we need is:

  • The URL so we can show it to the browser.
  • And the name and path of the file were we stored it (internal, OS dependant) in case we want to delete the file.
Bob Mulder
@bobmulder
In mean time this is done already? :)
Edwin
@EdwinKato
Hi Guys..Nid some help getting this to work..Any one online??
Bob Mulder
@bobmulder
Hey @Ugfighter, I'm here! If you want to report a bug, or discuss a new feature, you can do it here (vissible for everybody). If you need personal help just put it in a private chat with me, so we won't spam the rest ;)
Edwin
@EdwinKato
but i keep getting this errorError: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'avatar' cannot be null
Some one help
Bob Mulder
@bobmulder
Uhm I guess you have multiple columns called avatar in your database?
Edwin
@EdwinKato
Thanx @bobmulder ..You really helped me out
Bob Mulder
@bobmulder
:+1:
tuankiet2605
@tuankiet2605
Hello
everybody
I'm need help
I'm rebuild cakephp 3.x
I'm have problem about plugin cakemanager/cakephp-utils
I'm not know using this plugin
Please, help me via gmail: tuankiet2605@gmail.com
or skype: tuankiet2605
Thank you very much
Bob Mulder
@bobmulder
@tuankiet2605 hi, This chat is used to get he
Help or report problems. Please drop your issue here or chat me privately.
tuankiet2605
@tuankiet2605
Hello
Are you there?
Bob Mulder
@bobmulder
I am
MatthiasBusch
@MatthiasBusch
Hi guys
I am having trouble with the form forcing me to reupload my file everytime I update my model. Is there anything to prevent this?
Bob Mulder
@bobmulder
Hi @MatthiasBusch, can you give me some more details/error logs?
If you don't select a new file, it shouldn't be uploaded...
MatthiasBusch
@MatthiasBusch
I get the error, that the field image can't be left blank
so, the validation already fails, but if I disable the validation, the image path string will be overwritten
Bob Mulder
@bobmulder
That sounds very strange... Please drop me some info how to reproduce this so I can try it myself...
MatthiasBusch
@MatthiasBusch
sure, let me set something up
termlimit
@termlimit
once a user logs in, i am using GlobalAuth to get access to the id in a model. My question is how can i make my CakePHP models similar to this Laravel 4 call: $query = Auth::user()->accounts()->orderBy('accounts.name', 'ASC')
so i dont have to continuously get the user_id from the session, etc for each instance I need to check ownership
anybody getting up and getting out the of the house this weekend?
Bob Mulder
@bobmulder
hi @termlimit! just woke up, ill respond asap
Bob Mulder
@bobmulder
@termlimit you need to do something like $query = $this->Accounts()->find()->where(['Accounts.name' => Configure::read('GlobalAuth')['id']])
termlimit
@termlimit
@bobmulder thanks for the reply! I guess my question sucked. The goal I am aiming for is to use the User model class to perform ownership checks on specific calls. So something like $this->Users->Accounts->find('all') would only return the accounts specific to the logged in user. I could use a beforeFilter or before query call, but that can become restrictive if I don't want it.
I also thought about putting a custom finder method in the User model, that would add the user_id => Configure::read('GlobalAuth')['id'] to specific queries. I was going to try this later today. I think this may be the easiest way to reduce repeating the same call over and over again. Thanks for spurring my thoughts! Also, how do I mark code blocks here?
Bob Mulder
@bobmulder

@termlimit Gitter works with markdown. To create code-blocks you need to add 3 quotes who are above your Tab-button and before the 1-button. This quotes: ->`<- (haha, don't know how to explain :P). So add 3 quotes above your code, and after your code and your code will be shown in a block.

About your issue; I've always learned that Models should not handle ownership stuff. So in fact the model should not even know about roles and ownerships and stuff. And to be honest I agree with that. The GlobalAuth-behavior is just a thing to hack around it if you need it. So in your case you could create a custom finder as you mentioned. Your query-call would look like:

$this->Accounts()->find()->find('ownership', $userId);

I hope this will help you. Because this stuff isn't releated anymore to the utils-library I suggest you should contact me privately via Gitter if you have questions ;)

Have fun coding ;)

termlimit
@termlimit
@bobmulder thanks again for the awesome reply. I was worried it was out of the ballpark.
Mariano Paz
@mariano55555
Hi everyone...I need help with WhoDidIt behavior, I always get php Error: SQLSTATE[42000]: Syntax error or access violation: 1066 Not unique table/alias: 'CreatedBy'
Bob Mulder
@bobmulder
Anybody has this issue again? I've seens some more code, but couldn't find it...
mandeepkhaleriya08
@mandeepkhaleriya08
anybody can help me here ..How a user login with fb,gmail in cakephp 3.2?And how i do it
Bob Mulder
@bobmulder
I guess this is not a related question to this plugin, right @mandeepkhaleriya08 ?
Mateusz M
@micalmt_twitter
Hi. How would I correctly filter filenames before moving the uploaded file or saving its path in a DB?
For some reason I am cursed with having to remove \x09 from filenames, because users.
Bob Mulder
@bobmulder
Hi @micalmt_twitter, whats your issue exactly?
Mateusz M
@micalmt_twitter
Some of the files uploaded by my users somehow contain the tab character. I need to do something like str_replace("\x09", "\x20", $filename); on the uploaded file name, but I can't figure out how to do this properly (as in, without modyfing UploadableBehavior.php)
My guess is I need to look somewhere https://www.pastery.net/gxkqjg/ here