-
Notifications
You must be signed in to change notification settings - Fork 957
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
Comments - missing argument in comments.php function #2107
Comments
Thank you for reporting. Can you please share line 33-39 of your comments.php? |
Also which PHP version are you using? |
PHP version = 8.1.10 the comments.php file is unchanged Understrap Version: 1.2.2 this is lines 32 - 39 ( line 33 then starts with the if )
|
I can't replicate the issue. Also, the error message Are you using a translation plugin? Does this happen with the Understrap theme (no child theme activated) and no plugins activated? |
Hi, I have the same problem / error. I testet on my staging system and the problem is also there with the Understrap theme activated (instead of child theme) and with all plugins disabled. But it is only there if you have only one approved comment. Is the comment not approved the page is rendered without the error if you open it as an logged in administrator and see the comment. If you set all comments except for one to not approved the error is shown again.
|
Hi again, in line 36 of comments.php I changed
to
like in the else part for more than one comment. With this change it is working. |
except for
Still, I can't replicate this. I tested a post with exactly one comment and it works just fine. It also works for me with a post that has 1 comment approved and 1 comment unapproved.
This shouldn't do anything but breaking the translations because there are translations for @bacoords I have no idea what causes this. Do you have any idea? |
Just adding here that I've also been unable to replicate this error either. Wondering if anyone else is having it. |
Probably the error lies in the German translation file de_DE.po, where on line 89, placeholder 2$s is used instead of placeholder %s. |
Fatal error - is generated from line 37 of understrap\comments.php
**Understrap seems to be missing an argument - post with comment displays error message **
Wordpress new install (v. 6.1.1 ) - the default post with comment (vanilla install), after activating the theme, an error message is shown instead of the comment. (applies also to a child theme of course).
Fatal error: Uncaught ArgumentCountError: 3 arguments are required, 2 given in [localpath-to-wordpress]\wp-content\themes\understrap\comments.php:37 S tack trace: #0 [localpath-to-wordpress]\wp-content\themes\understrap\comments.php(37): printf('Ein Gedanke zu ...', '<span>Hallo Wel...') #1 [localpath-to-wordpress]\wp-includes\comment-template.php(1550): require('[localpath-to-server]\...') #2 [localpath-to-wordpress]\wp-content\themes\understrap\single.php(36): comments_template() #3 [localpath-to-wordpress]\wp-includes\template-loader.php(106): include('[localpath-to-server]\...') #4 [localpath-to-wordpress]\wp-blog-header.php(19): require_once('[localpath-to-server]\...') #5 [localpath-to-wordpress]\index.php(17): require('[localpath-to-server]\...') #6 {main} thrown in [localpath-to-wordpress]\wp-content\themes\understrap\comments.php on line 37
PS - In my case: comments will be deactivated (so no error will be shown) - HOWEVER relevant for any site using comments.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Comment should be shown
The Environment
The text was updated successfully, but these errors were encountered: