Change "Post New Thread" Button (per forum)

Change "Post New Thread" Button (per forum) 1.0

No permission to download
Really? That is pretty bizarre :s

I'm in meetings till later this afternoon so will look at it after then.

Can you please find out for me if the button text specified in the forum edit screen is being wiped, or if the text is still there. I need to know if the text itself is being wiped from the field, or if the template modification itself is just not getting applied.
 
Ok.... it seems that any post, or new thread wipes out the button text itself from the database.

@Chris D Do you know if forum information in the dataRegistry is ever written back to the forum table? Is xenForo doing some sort of "restore" process? I'm finding this hard to get my head around.

I can't fathom how else this could happen since a new post or thread has precious little to do with the xf_forum table - I'll need to investigate this further.
 
Your code to set the value of the newthread_button_title field runs on _preSave. Lots of things write to the forum table. Discussion count, for one.

The way your code works at the minute:
  1. Forum DataWriter is created
  2. Data is set on certain fields (e.g. discussion_count / message_count is increased)
  3. Save is called on the DW - this calls preSave first.
  4. Your preSave method checks if 'newthread_button_title' is set in the user's session. If it is, the button title is set, if it isn't the button title is set to ''
Long story short, whenever the Forum DW is called, it will reset the button to default.

(Sounds like one for the Dev forum).
 
Hmmmm... balls.
Back to the drawing board on one aspect. Ok, I'll sort this. Think I understand, basically it's just checking the application "Registered" variables... Which only exist for not long in the session, and only in "my"session, as admin?
 
Top Bottom