Skip to main content
mpdonadio's user avatar
mpdonadio's user avatar
mpdonadio's user avatar
mpdonadio
Moderator
  • Member for 13 years, 8 months
  • Last seen this week
  • Philadelphia, PA
comment
Why doesn't currentUser return correct permissions?
@AbdulSadikYalcin Can you provide context about where $this->currentUser is getting called from? Service, controller, form, etc? And does your editor hint what the type of $this->currentUser is? It is a little hard to guess here, but I suspect you have an Account and not a User. This is a really confusing part of core, where when you have an Account you need to load the full user for some scenarios.
awarded
comment
What version of Drupal am I running?
In addition to the answers below, you should also consider that a Drupal 4.7 site that hasn't been touched is likely compromised, either the site itself from unapplied patches or issued addressed in later versions, or the server itself since the Apache 1.x / PHP 4.x.
awarded
comment
How to modify the timezone options list?
I need to check my list, but I am nearly positive there is an open issue to add an alter hook for this.
awarded
awarded
awarded
Loading…
comment
Why is composer refusing update 9.4.3 -> 9.4.5
I think you may be going down a rabbit hole with the modules at this point. Can you edit if your actual composer.json? If this is an older site, I suspect you have some root dependencies that are no longer needed (ie, your composer.json hasn't tracked with changes to the best practices).
comment
DrupalDateTime::createFromFormat() returns the wrong time value
@Kevin Unix timestamps by definition are the number of seconds (minus leap second) since 00:00:00 UTC on 1 January 1970. Internally, Drupal does everything in UTC ; time zones are an input/output thing.
awarded
comment
Why am I getting different results for entity::save() between REST and web?
Have you put xdebug on this or have you verified via Storm / IDE that all of the types are correct? What type is $this coming in as? I think you have one of two problem. (1) User vs Account object or (2) String vs DateTimeZone problem. I am on wrong computer, but I don't think you need the explicit timezone_open calls. I think proper DateTimeZone objects are always passed around in the API.
awarded
awarded
comment
how to convert date into timestamp using timezone
That DB query is open to SQL injection. Please read drupal.org/docs/drupal-apis/database-api/… for how to safely handle the parameters.
comment
Tarball 9.3.0 to Composer 9.3.0
I am trying to find my writeup about this. I suspect it was an answer here, but I can't find it. I would add an answer here, but it has been a few years since I have done this. You are on the right path. I believe your next step would be to take your new composer.json, and then copy it into your site. Then rename directories to match the installer paths, and delete what would be the build artifacts managed by composer. Then composer install ; drush cr.
1
2 3 4 5
249