Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2009-06-05 15:12:51

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,453
Website GitHub

Suspected bug in per-user set_pref()

Expected outcome: altering a per-user pref of one user changes the pref for that user only.
Actual outcome: altering a per-user pref of one user changes the same pref for all users.

Steps to reproduce:

  1. Create 2 user accounts
  2. Log into TXP in two browsers, once with each account
  3. Visit the Articles list with both accounts
  4. Alter the sort order with one of the accounts
  5. Refresh the browser window of the other account: the sort order has changed to that of the other user

Fix: In txplib_misc.php, if the pref does not exist, safe_insert() creates it with a user_name. But if it is subsequently changed, the safe_update() does not take user_name into account and thus changes all such-named prefs.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#2 2009-06-05 17:22:04

wet
Developer Emeritus
From: Schoerfling, Austria
Registered: 2005-06-06
Posts: 3,330
Website Mastodon

Re: Suspected bug in per-user set_pref()

Thanks for the report. Fixed in r3208.

Offline

Board footer

Powered by FluxBB