Cacti / cacti

Cacti ™
http://www.cacti.net
GNU General Public License v2.0
1.6k stars 397 forks source link

When i save, The style of PHP is missing #5750

Closed aliuzzz closed 1 week ago

aliuzzz commented 1 month ago

image when i save,The style of the page's PHP will be lost

image

aliuzzz commented 1 month ago

image this page

aliuzzz commented 1 month ago

Including creating new images, styles will also be lost after clicking on create graphs_new.php

xmacan commented 1 month ago

Cannot reproduce on actual 1.2.27? What cacti version?

aliuzzz commented 1 month ago

rocky9.4+php8.2.13+cacti1.2.27+mariadb10.5.22+net-snmp5.9.1+httpd2.4.57

aliuzzz commented 1 month ago

i this the question is here, "header=false" show be "header=true" image

xmacan commented 1 month ago

last screenshot has different url. Still cannot reproduce. Please describe all steps, something like: 1) go to templates -> graphs 2) choose any graph 3) click save...

aliuzzz commented 1 month ago

Management-->Device-->Create Graphs for this Device-->Create graphs After clicking Create, the image was successfully added, but the style was lost image

image

aliuzzz commented 1 month ago

image In version 1.2.26, this bug was not found after clicking "Create"

xmacan commented 1 month ago

still cannot reproduce. Try clear browser cache, try another browser

aliuzzz commented 1 month ago

I changed devices and browsers and the problem recurred.This problem occurs every time Apache/2.4.57 +PHP 8.2.13 (cli)+mysql Ver 15.1 Distrib 10.5.22-MariaDB+ NET-SNMP version: 5.9.1+RRDtool 1.8.0

Maybe it has something to do with it?

aliuzzz commented 1 month ago

Maybe I'm trying to use an older version of which file? For example graphs_new?

TheWitness commented 1 month ago

Any JavaScript errors? Where is header=true set?

aliuzzz commented 1 month ago

I'm not sure, but the fact is that changing the header=false to true in the link can restore it. However, in version 1.2.26, when performing the above operation, the "header" will not be seen in the link

TheWitness commented 1 month ago

Pull the latest graphs_new.php and see if it's reproducible.

TheWitness commented 1 month ago

Are you using MacTrack also?

aliuzzz commented 1 month ago

I did not use mactrack I replaced the latest graphs new. php, but it did not fix this bug

But I found a problem, which occurs when I use Chinese as my GUI language. When using other languages (such as English and Spanish), it works fine

aliuzzz commented 1 month ago

In Chinese language, it is also not possible to create aggregation templates

TheWitness commented 1 month ago

Maybe that's the source of the issue. Is it fine if English?

aliuzzz commented 1 month ago

Yes,it is fine in English、French 、German, I'm curious, is this influenced by UTF-8?

linqianye commented 3 weeks ago

It doesn't seem to solve the problem. In fact, after submitting data on any page that requires submission, the style will be lost. It seems to be a global setting issue.

aliuzzz commented 2 weeks ago

Yes, It is a global setting issue.But in Chinese state, this issue does not exist. I really hope the author will also consider Chinese users. Here, Cacti is a widely recognized monitoring platform, which is why I have always insisted on using platforms such as Zabbix to replace Cacti

TheWitness commented 2 weeks ago

Did you pull the latest graphs_new.php?

aliuzzz commented 2 weeks ago

Yes, I download the latest graphs_new.php in version 1.2.x and i have restarted the system and services, but the issue has not been resolved in the Chinese environment.

TheWitness commented 2 weeks ago

Show the latest URL that generates the error.

aliuzzz commented 2 weeks ago

image For example, when I put the newly added switch on the tree .Then i click confirm and the URL chagne to this I don't know where the problem is,but other languages are fine, only Chinese has such poor display status

TheWitness commented 1 week ago

Can you provide the exact steps to reproduce from the time you sign in till the time the issue occurs?

aliuzzz commented 1 week ago

It happens in a lot of places, and I'll just give you one quick example.

  1. Log in
  2. Click "Manage" -- "Devices"
  3. Select a device and select "Put it on the tree".
  4. Click OK.
  5. Click "Continue" directly in the pop-up dialog box. And then Lost the style
hljtql commented 1 week ago

Yes, this issue only occurs in the Chinese environment, and it almost always appears in any submission section. At this point, a dialog box indicating successful operation should have popped up, but it did not appear. Instead, a page with header=false appears

hljtql commented 1 week ago

I found the reason, because only the Chinese environment had this problem, so I suspected Chinese translation problem, so I replaced the zh-CN.mo of 1.2.27 with the zh-CN.mo of 1.2.26 and the problem was solved...... But, how exactly did this come about?

TheWitness commented 1 week ago

Goto https://translate.cacti.net and see if you can contribute to the Cacti Translation for Chinese. There are a few string patterns that Google and Microsoft can not figure out. Also, please try to build from the latest zh-CN.po in GitHub. You can find it in the 1.2.x branch at locales/po/zh-CN.po. Once you download that file, in the locales directory there is a build_gettext.sh. Run that script and Chinese will be rebuilt.

Below is a screenshot using POEDIT for Windows showing all the errors in translation. If you create an account at https://translate.cacti.net you can simply find the strings that need work, and make the changes on the fly. We need the help.

image

TheWitness commented 1 week ago

I uploaded an updated zh-CN.po file that has all the errors untranslated again. Need help. Closing this one.