Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2025-02-27 22:58:25

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

Odd announce message on clean 4.9.0-dev install

Can anyone replicate this? I’m testing beta.2 (latest dev) prior to release and if I do a fresh install on a server running PHP 8.2, when I visit the Articles panel and click to edit the Welcome article, it opens and immediately issues a yellow (warning) announce message:

Last modified by 

And that’s it. No name. Just an empty warning. I can carry on. If I save the article, the issue goes away next time I click through to edit the article. It’s only on very first visit prior to saving the article (and thus assigning a LastModID).

Doesn’t do it on the demo server, as far as I can see (although that has a username of textpattern-robot assigned to the article). My initial welcome article shows this under the Title field:

ID# 1 · Posted by stef · 27 Feb 2025 10:52 PM

i.e. no LastModID (a fact borne out by the database, which has an empty field there). My guess is that it’s seeing no LastModID and panicking, but why? It’s not trying to save the article as soon as the panel is loaded… is it? Or is the new iframe for handling the Preview functionality doing some sort of ‘save’ trick to populate itself with live content in advance of the article being viewed?

Can anyone replicate this or offer an idea of a fix? I’m stumped.


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 2025-02-27 23:28:23

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

Re: Odd announce message on clean 4.9.0-dev install

Update: Ah, the edit step calls article_preview() which checks if the ‘view’ mode is being used (it shouldn’t be on first load). But as far as I can tell, it does nothing.

Something must be triggering that mode, though. Probably textpattern.js. Hmmm…


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

#3 2025-02-27 23:35:00

phiw13
Plugin Author
From: South-Western Japan
Registered: 2004-02-27
Posts: 3,356
Website

Re: Odd announce message on clean 4.9.0-dev install

I think that message comes from the sanitation logic part of the preview dialog (the one linked from the button above the textarea). At least on my test install I have articles edited/saved by user-2. When user-1 view that article for editing, that message appears.

Why is it doing that on a fresh install is a bit of a mystery, though. It’s been a while since I created a fresh install.

–^–

Edit: Ok, tested a new install, same message (testing mode).

Last edited by phiw13 (2025-02-27 23:49:29)


Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern

Offline

#4 2025-02-28 00:12:05

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

Re: Odd announce message on clean 4.9.0-dev install

Okay, thanks for testing. Glad it’s not just me.

I think you’re right that it’s the sanitization or the way the preview dialog is pre-populated on the page.

Doesn’t do it for me if I create an article, owned by a second (Managing Editor) user, and click to edit it via my main (Publisher) account, though. It does issue the usual red warning if I try and save it, which is expected.

However, if I Save the second guy’s article with my main Publisher account (thus updating its LastModID), when I subsequently click from the Articles panel with my second user account to access the article, I get Last modified by stef pop up immediately on panel load.

So maybe the hierarchy makes a difference? Or maybe it doesn’t trigger for Publishers unless the LastModID isn’t set at all? I can’t quite make out the logic here so more testing is required.

Hopefully Oleg can shine some light on this.


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

#5 2025-02-28 00:29:58

phiw13
Plugin Author
From: South-Western Japan
Registered: 2004-02-27
Posts: 3,356
Website

Re: Odd announce message on clean 4.9.0-dev install

On my test site:

  • an article created by user-2 (managing editor), edited by user-1 (publisher), viewed by user-2 triggers the warning. User-2 edits that article, user-1 views that: no warning.
  • an article created by user-1, viewed and edited by user-2 (has the warning on first view. user-1 visits the Write panel, it triggers the warning.

The first situation above seems a little buggy, I think – did something change recently that changed that behaviour? I think I remember a different behaviour.


Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern

Offline

#6 2025-02-28 07:18:36

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

Re: Odd announce message on clean 4.9.0-dev install

Yeah, I don’t know. The inconsistency does feel like a bug.

I’m not sure it should be showing any messages on page load. In theory it’s easy to stop the one that pops up when it’s empty by just checking if the LastModID is set. But that still means it shows up if the author is different… in some cases.

Better would be not to call any kind of save routine until the user actually commits changes. I’m not entirely sure why that test is there anyway. Don’t we only care if the content has been modified by someone else while another user is editing the same article?

Possibly Oleg can enlighten us what that test does and why it’s necessary for the preview.


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

#7 2025-02-28 15:26:27

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,853
Website GitHub

Re: Odd announce message on clean 4.9.0-dev install

I can confirm this too. The empty message at the beginning occurs when there was no previous author.

Bloke wrote #339163:

I’m not sure it should be showing any messages on page load.

I agree. It feels like there’s been some anomaly before one has even started.


TXP Builders – finely-crafted code, design and txp

Offline

#8 2025-03-01 00:07:40

phiw13
Plugin Author
From: South-Western Japan
Registered: 2004-02-27
Posts: 3,356
Website

Re: Odd announce message on clean 4.9.0-dev install

I think Oleg intended this as a security feature: e.g. it gives a warning to the (original) author that the article has been edited by someone else and the (current) author should thus proceed with care.

To me, that feels a little overkill. Maybe. Or maybe I don’t live in a low-trust environment.

The absence of a message when the Publisher views his or her own articles edited by an other user is quite troubling.


Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern

Offline

#9 2025-03-01 06:12:53

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,151
Website GitHub Mastodon Twitter

Re: Odd announce message on clean 4.9.0-dev install

phiw13 wrote #339168:

The absence of a message when the Publisher views his or her own articles edited by an other user is quite troubling.

Agree!

An easy way to approach this is to highlight the Last modified by part under the title field.


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#10 2025-03-01 06:53:38

phiw13
Plugin Author
From: South-Western Japan
Registered: 2004-02-27
Posts: 3,356
Website

Re: Odd announce message on clean 4.9.0-dev install

colak wrote #339169:

An easy way to approach this is to highlight the Last modified by part under the title field.

something: [if_different]@<span class=“author-edit”>last modified……@[/if_different] ? when original author is different from the last edit author.


Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern

Offline

#11 2025-03-01 16:57:00

etc
Developer
Registered: 2010-11-11
Posts: 5,345
Website GitHub

Re: Odd announce message on clean 4.9.0-dev install

Sorry, I was offline this week. Yes, this warning must be a relics of various security checks, though it looks like overkill in its present state.

Nonetheless, the discrepancy between AuthorID and LastModID of the welcome article looks like a setup oversight and might fire somewhere else. IIRC, all new articles saved via txp interface have AuthorID = LastModID.

Offline

#12 2025-03-01 17:28:54

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

Re: Odd announce message on clean 4.9.0-dev install

Yeah maybe the setup script should force LastModID to the same as the AuthorID. That would at least get rid of that initial warning (assuming the first person to log in and edit the article is the same user).

Doesn’t remove the weirdness of only being warned in some instances, but that is probably some other trigger.


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

Board footer

Powered by FluxBB