cacti icon indicating copy to clipboard operation
cacti copied to clipboard

When i save, The style of PHP is missing

Open aliuzzz opened this issue 1 year ago • 19 comments

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

image

aliuzzz avatar May 15 '24 07:05 aliuzzz

image this page

aliuzzz avatar May 15 '24 07:05 aliuzzz

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

aliuzzz avatar May 15 '24 07:05 aliuzzz

Cannot reproduce on actual 1.2.27? What cacti version?

xmacan avatar May 15 '24 07:05 xmacan

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

aliuzzz avatar May 15 '24 09:05 aliuzzz

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

aliuzzz avatar May 15 '24 09:05 aliuzzz

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...

xmacan avatar May 15 '24 10:05 xmacan

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 avatar May 16 '24 01:05 aliuzzz

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

aliuzzz avatar May 16 '24 01:05 aliuzzz

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

xmacan avatar May 16 '24 08:05 xmacan

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 avatar May 17 '24 07:05 aliuzzz

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

aliuzzz avatar May 17 '24 07:05 aliuzzz

Any JavaScript errors? Where is header=true set?

TheWitness avatar May 17 '24 10:05 TheWitness

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

aliuzzz avatar May 18 '24 01:05 aliuzzz

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

TheWitness avatar May 18 '24 13:05 TheWitness

Are you using MacTrack also?

TheWitness avatar May 18 '24 13:05 TheWitness

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 avatar May 20 '24 02:05 aliuzzz

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

aliuzzz avatar May 25 '24 03:05 aliuzzz

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

TheWitness avatar May 25 '24 11:05 TheWitness

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

aliuzzz avatar May 27 '24 02:05 aliuzzz

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.

linqianye avatar Jun 07 '24 02:06 linqianye

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

aliuzzz avatar Jun 11 '24 01:06 aliuzzz

Did you pull the latest graphs_new.php?

TheWitness avatar Jun 11 '24 09:06 TheWitness

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.

aliuzzz avatar Jun 12 '24 04:06 aliuzzz

Show the latest URL that generates the error.

TheWitness avatar Jun 16 '24 15:06 TheWitness

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

aliuzzz avatar Jun 17 '24 06:06 aliuzzz

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

TheWitness avatar Jun 17 '24 19:06 TheWitness

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

aliuzzz avatar Jun 19 '24 08:06 aliuzzz

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 avatar Jun 19 '24 14:06 hljtql

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?

hljtql avatar Jun 19 '24 14:06 hljtql

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 avatar Jun 20 '24 00:06 TheWitness