Drupal 7 port of #2842942: Fix tempnam() usage in PHP7.1

Problem/Motivation

Using tempnam() in PHP7.1 can result in PHP warnings if it falls back to the system temporary directory. This is the case for some of our tests.

Locale.LocaleExportFunctionalTest
✓		- setUp
✗	
testExportTranslation
exception: [Notice] Line 1343 of modules/locale/locale.test:
tempnam(): file created in the system's temporary directory
✓		- testExportTranslationTemplateFile

See https://bugs.php.net/bug.php?id=69489
See https://www.drupal.org/pift-ci-job/587879

Proposed resolution

Don't use temporary:// as the stream wrapper is not defined.

Remaining tasks

User interface changes

None

API changes

None

Data model changes

None

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

alexpott created an issue. See original summary.

alexpott’s picture

alexpott’s picture

hazong’s picture

Hi,
I would like to work on this issue.

stefan.r’s picture

Status: Needs review » Reviewed & tested by the community
David_Rothstein’s picture

Status: Reviewed & tested by the community » Fixed

Committed to 7.x - thanks!

Status: Fixed » Closed (fixed)

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