This is a follow up issue on #3000057: Deprecate drupal_set_time_limit() and file_upload_max_size() and move to Environment component and its change record.

Problem/Motivation

It seems that the 8.7.x and onwards have the deprecation warning for drupal_set_time_limit() wrong and suggests it as per the below:

 * @deprecated in Drupal 8.7.0 and will be removed before Drupal 9.0.0. Use
 *   \Drupal\Core\Environment::setTimeLimit() instead.
 *
 * @see https://www.drupal.org/node/3000058
 */
function drupal_set_time_limit($time_limit) {
  @trigger_error('drupal_set_time_limit() is deprecated in Drupal 8.7.0 and will be removed before Drupal 9.0.0. Use \Drupal\Core\Environment::setTimeLimit() instead. See https://www.drupal.org/node/3000058.', E_USER_DEPRECATED);
  Environment::setTimeLimit($time_limit);
}

Proposed resolution

The other procedural functionfile_upload_max_size() seems like it has been updated with the correct namespace, but drupal_set_time_limit() still needs to point to namespace Drupal\Component\Utility\Environment for both the annotation and @trigger_error message.

Remaining tasks

Review & test.

User interface changes

None.

API changes

None.

Data model changes

None.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

baikho created an issue. See original summary.

baikho’s picture

baikho’s picture

Issue summary: View changes

Status: Needs review » Needs work
baikho’s picture

andrewmacpherson’s picture

Status: Needs review » Reviewed & tested by the community

Nice. Patch is #5 is perfect.

I read the previous issue to make sure I understood it, then grepped for Drupal\Core\Environment before and after the patch to make sure it got them all.

The change record from the previous issue was already corrected, see https://www.drupal.org/node/3000058/revisions/view/11316499/11316522

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed 2dd12f9 and pushed to 8.8.x. Thanks!

The patch conflicts on 8.7.x so didn't bother to backport.

  • alexpott committed 2dd12f9 on 8.8.x
    Issue #3073988 by baikho: Wrong namespace in deprecation message...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.