Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The first comment shows only when page is refreshed #10

Closed
alanmels opened this issue Aug 16, 2023 · 3 comments · Fixed by #12
Closed

The first comment shows only when page is refreshed #10

alanmels opened this issue Aug 16, 2023 · 3 comments · Fixed by #12

Comments

@alanmels
Copy link
Member

alanmels commented Aug 16, 2023

Subj. Tested on a fresh Backdrop setup. The first comment (or multiple) never show unless you refresh the respective page. After the refresh everything works as expected.

So the first test comment in the below screenshot did not show up until the page was refreshed. Comments 2 and 3 showed as expected without page refresh.

Screenshot 2023-08-16 at 10 43 36 PM
@alanmels
Copy link
Member Author

The https://docs.backdropcms.org/api/backdrop/core%21modules%21comment%21comment.theme.inc/1 lists only three functions available:

template_preprocess_comment Preprocesses variables for comment.tpl.php.
theme_comment_block Returns HTML for a list of recent comments.
theme_comment_post_forbidden Returns HTML for a "you can't post comments" notice.

template_preprocess_comment Preprocesses variables for comment.tpl.php.
theme_comment_block Returns HTML for a list of recent comments.
theme_comment_post_forbidden Returns HTML for a "you can't post comments" notice.

So apparently the template_preprocess_comment_wrapper() of Drupal 7 was dropped on Backdrop, therefore the ajax_comments_preprocess_comment_wrapper(&$variables) never kicks in.

@alanmels
Copy link
Member Author

After reading https://docs.backdropcms.org/change-records/new-layout-module-implements-a-drag-drop-model-for-building-layouts I came to conclusion that the least intrusive way to address this issue would be implementing the hook_preprocess_page() not to deal with layouts, because websites can change their layout templates and the solution needed to be universal.

@laryn
Copy link
Member

laryn commented Aug 17, 2023

@alanmels I never got back to this project and haven't needed it on a client project recently, but I was investigating the same issue over here, I think:

I don't know that I found anything that you haven't already discovered. Feel free to close that other issue and rough work-in-progress PR as you see fit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants