This patch lets you set a variable only for the run of the Drupal. From base_path() i think we like functions better than globals :)

Comments

chx’s picture

StatusFileSize
new1.07 KB

d'oh! in preview I can't read the patch.

killes@www.drop.org’s picture

looks good to me.

dries’s picture

Erm, what is the use case? :-) Can we clean up some stuff?

moshe weitzman’s picture

sounds good. i got odd message when trying to patch though: "patch: **** Only garbage was found in the patch input."

this gave me the idea about how we should do user switching. several modules like mailhandler and masquerade and devel switch the currently logged in user during the request. they attempt to switch the user back later but if something happens tothe request, the current user can actually have their session switched to another user. I think we could use this same trick to assure that the session table records are never switched, and thus the impersonation could not persist.

dries’s picture

Status: Needs review » Needs work
LAsan’s picture

Version: x.y.z » 7.x-dev

Still applies to current version?

Freso’s picture

Version: 7.x-dev » 8.x-dev

I guess 7.x is closed for features by now...

marvil07’s picture

Status: Needs work » Needs review
StatusFileSize
new1.35 KB

Just an update of the patch, changing also the name of the added parameter to persistent.

Status: Needs review » Needs work

The last submitted patch, 0001-Issue-71113-by-chx-Set-a-variable-only-temporary.patch, failed testing.

chx’s picture

Status: Needs work » Needs review
thedavidmeister’s picture

Title: Set a variable only temporary » Set a variable only temporarily
Status: Needs review » Reviewed & tested by the community

this seems fine to me.

alexpott’s picture

Status: Reviewed & tested by the community » Closed (won't fix)

Marking this as won't fix as variable_set() will be gone from Drupal 8...

thedavidmeister’s picture

I did wonder about that, I thought it had already been removed but there it was, sitting in HEAD so I assumed it was still doing something. I should have just asked in IRC, apologies.