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.
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.
Comment | File | Size | Author |
---|---|---|---|
#5 | interdiff_1-5.txt | 770 bytes | baikho |
#5 | drupal-wrong_namespace_deprecation_drupal_set_time_limit-5.patch | 1.98 KB | baikho |
#2 | drupal-wrong_namespace_deprecation_drupal_set_time_limit-1.patch | 1.08 KB | baikho |
Comments
Comment #2
baikhoComment #3
baikhoComment #5
baikhoComment #6
andrewmacpherson CreditAttribution: andrewmacpherson as a volunteer commentedNice. 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
Comment #7
alexpottCommitted 2dd12f9 and pushed to 8.8.x. Thanks!
The patch conflicts on 8.7.x so didn't bother to backport.