[3.0]: add $possible_topic_columns to integrate_modify_post #8318
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
I have a modification (Topic Descriptions) that adds a column to
smf_topics
. Currently, a separate query is necessary to update the topics table. This commit allows for adding the new column to the existing query.Description
Introduction of
$possible_topic_columns
:$possible_topic_columns
, is added to map topic option keys (e.g.,sticky_mode
,lock_mode
,poll
) to their corresponding database column names and data types.Enhancements to the
integrate_modify_post
Hook:integrate_modify_post
hook now includes the new$possible_topic_columns
array, enabling mods to interact with these columns more effectively.The
$possible_topic_columns
array introduced in the patch is an associative array. Its structure is as follows:Example from the Patch
Details:
Keys (
'sticky_mode'
,'lock_mode'
,'poll'
):$topicOptions
array, passed as input to the function.Values:
'int'
,'string'
, etc.) for parameter binding in the query.'is_sticky'
,'locked'
,'id_poll'
).