Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Fixed mistake with using $this in a static function
Comment | File | Size | Author |
---|---|---|---|
#2 | google_analytics-2977908-2.patch | 2.99 KB | pifagor |
|
Comments
Comment #2
pifagorComment #3
alex_optimLooks good.
Comment #4
hass CreditAttribution: hass commentedThis was changed in last month and has not caused any issues. What is wrong here?
Comment #5
pifagorYou use $this in a static method, for example
protected static function validateCreateFieldValue
use$this->t('The value of
More info here - http://php.net/manual/en/language.oop5.static.php
Comment #8
hass CreditAttribution: hass commentedComment #10
Anitche ekpereamaka CreditAttribution: Anitche ekpereamaka commentedhello am having this issue
public static function createFromGlobals(): static
{
$request = self::createRequestFromFactory($_GET, $_POST, [], $_COOKIE, $_FILES, $_SERVER);
if (str_starts_with($request->headers->get('CONTENT_TYPE', ''), 'application/x-www-form-urlencoded')
&& \in_array(strtoupper($request->server->get('REQUEST_METHOD', 'GET')), ['PUT', 'DELETE', 'PATCH'])
) {
parse_str($request->getContent(), $data);
$request->request = new InputBag($data);
}
return $request;