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

Some display strings have invalid formatting that cannot be parsed #5402

Closed
jimidak opened this issue Jul 14, 2023 · 14 comments
Closed

Some display strings have invalid formatting that cannot be parsed #5402

jimidak opened this issue Jul 14, 2023 · 14 comments
Labels
bug Undesired behaviour confirmed Bug is confirm by dev team porting required Requires porting to develop resolved A fixed issue
Milestone

Comments

@jimidak
Copy link

jimidak commented Jul 14, 2023

Describe the bug

PHP string var substitution

To Reproduce

Steps to reproduce the behavior:

  1. Go to '...'
    Management. --> Trees --> (could be any tree)

  2. Click on '....'
    some tree, and then "Edit Tree"

  3. See error
    "This tree has been locked for Editing on %1$s by %2$s."

Expected behavior

"This tree has been locked for Editing on 2023-07-13 19:13:53 by admin."

A clear and concise description of what you expected to happen.
THE PHP TEMPLATE/VARIABLE POPULATED WITH ACTUAL TIMESTAMP & USER

Screenshots

Screenshot 2023-07-13 at 6 14 45 PM

Desktop (please complete the following information)

  • OS: [e.g. iOS]
    UBUNTU 20.04

  • Browser [e.g. chrome, safari]
    BRAVE

  • Version [e.g. 22]
    1.52.130

Additional context

tree.php - The 2 sprintf string variables (‘%1$s by %2$s’) are not getting substituted by the first and second parameters 'locked_date' & '(get_username($tree['modified_by’])'. Nothing in cacti logs or mysql (mariadb) logs.



versions:

OS Ubuntu 20.04.5 (5.4.0-137 kernel)
RRDtool 1.7.2-3 build2
NET-SNMP 5.8
PHP 7.4.3
MariaDB 10.5.18
Apache 2.4.41
Spine 1.2.23
Cacti 1.2.24

Add any other context about the problem here.

@jimidak jimidak added bug Undesired behaviour unverified Some days we don't have a clue labels Jul 14, 2023
@TheWitness
Copy link
Member

Thanks @jimidak. The debian dpk builds are a little different than source builds due to some issues with deprecated libraries. Thank for reporting though.

@jimidak
Copy link
Author

jimidak commented Jul 14, 2023

Thank you @TheWitness. Appreciate the feedback. This was probably better posted on the phpBB Cacti Forum, but if there's any help here I can get, it would be appreciated.

@TheWitness
Copy link
Member

@jimidak, grab the global_languages.php from the 1.2.x branch and see if that fixes it. I distinctly remember this being reported before.

1 similar comment
@TheWitness
Copy link
Member

@jimidak, grab the global_languages.php from the 1.2.x branch and see if that fixes it. I distinctly remember this being reported before.

@netniV
Copy link
Member

netniV commented Jul 14, 2023

It was reported and fixed before.

@jimidak
Copy link
Author

jimidak commented Jul 14, 2023

@netniV , Sorry Mark, I searched issues, opened and closed, and couldn't find anything. Can you pls point me to it?

@jimidak
Copy link
Author

jimidak commented Jul 14, 2023

@TheWitness , replacing global_languages.php from the 1.2.x branch didn't seem to have any efffect.

@netniV
Copy link
Member

netniV commented Jul 14, 2023

I'm pretty sure it was done as part of #5147 but there were a few other commits that addressed things too.

@netniV
Copy link
Member

netniV commented Jul 14, 2023

That said, @TheWitness did update login form in 3088272 for issue #5152 which seems to be this same issue so maybe that's why it sounds familar to us both. If so, it's still outstanding and we may need to double check for these usages?

@jimidak
Copy link
Author

jimidak commented Jul 14, 2023

@netniV Thanks for the follow-up. And that 5152 issue sure looks liek the same type of ordered placeholder issue

@TheWitness
Copy link
Member

It'll be raining here in SE Michigan tomorrow. Will spend some time digging through it if you don't beat it tom me @netniV.

@TheWitness TheWitness changed the title tree.php - php tokens (%1$s by %2$s) not replaced by parameter, and printed literally in Cacti UI Tree Mode Cacti translations including less compatible language replacement characters in a few locations Jul 15, 2023
@TheWitness TheWitness added confirmed Bug is confirm by dev team and removed unverified Some days we don't have a clue labels Jul 15, 2023
@TheWitness TheWitness added resolved A fixed issue porting required Requires porting to develop labels Jul 15, 2023
@TheWitness TheWitness added this to the v1.2.25 milestone Jul 15, 2023
@TheWitness
Copy link
Member

Grab a fresh copy of tree.php from the 1.2.x branch. I found this syntax in a few more locations as well and have resolved the same issue there.

@jimidak
Copy link
Author

jimidak commented Jul 17, 2023

@TheWitness , I downloaded the updated tree.php, rebooted the cacti server, logged back into the cacti UI, and tried again... and now it's working!! Thank you @TheWitness and @netniV, for your time and effort. Very appreciated.

When I unlock a tree for editing, now I get the time and username. ex.
This tree has been locked for Editing on 2023-07-17 10:32:00 by Jane Doe

@TheWitness
Copy link
Member

Sure. Thanks for confirming. Note that in PHP WebApps reboot and the like is never required when using Apache.

@netniV netniV changed the title Cacti translations including less compatible language replacement characters in a few locations Some display strings have invalid formatting that cannot be parsed Sep 3, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Dec 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Undesired behaviour confirmed Bug is confirm by dev team porting required Requires porting to develop resolved A fixed issue
Projects
None yet
Development

No branches or pull requests

3 participants