Issue #44: Replace StdClass with Node. - #45
Open
jenlampton wants to merge 1 commit into
Open
Conversation
herbdool
reviewed
Jul 18, 2025
|
|
||
| // Merge in the "Last Post" information. | ||
| $last_post = new stdClass(); | ||
| $last_post = new Node(); |
Contributor
There was a problem hiding this comment.
Suggested change
| $last_post = new Node(); | |
| $last_post = entity_create('node', array()); |
I think we standardizing in core to use entity_create() instead of creating entities with new X.
herbdool
reviewed
Jul 18, 2025
|
|
||
| $order = _forum_get_topic_order($sortby); | ||
| for ($i = 0; $i < count($forum_topic_list_header); $i++) { | ||
| for ($i = 1; $i < count($forum_topic_list_header); $i++) { |
Contributor
There was a problem hiding this comment.
This is part of another PR which was merged so this no conflicts.
herbdool
reviewed
Jul 18, 2025
| $first_new_found = FALSE; | ||
| foreach ($result as $topic) { | ||
| foreach ($result as $topic_result) { | ||
| $topic = new Node($topic_result); |
Contributor
There was a problem hiding this comment.
Suggested change
| $topic = new Node($topic_result); | |
| $topic = new entity_create('node', $topic_result); |
herbdool
reviewed
Jul 18, 2025
|
|
||
| if ($topic->comment_count > 0) { | ||
| $last_reply = new stdClass(); | ||
| $last_reply = new Node(); |
Contributor
There was a problem hiding this comment.
Suggested change
| $last_reply = new Node(); | |
| $last_reply = new entity_create('node', array()); |
Contributor
|
@jenlampton I've suggested small changes. Otherwise looks good. I've also tested it and no errors (but I wasn't able to replicate the original error either). |
|
Any timescale on when this PR shall be merged? I've just hit this same error on our client's site. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #44