From b90844f7afc16e70a4174aef9da9fabd439a26a1 Mon Sep 17 00:00:00 2001 From: TheWitness Date: Tue, 26 May 2026 08:18:16 -0400 Subject: [PATCH 1/3] fix: Rendering issues when map page includes pull down with several maps --- CHANGELOG.md | 3 ++ locales/po/cacti.pot | 60 ++++++++++++++++++++----------------- weathermap-cacti-plugin.php | 20 +++++++++---- 3 files changed, 51 insertions(+), 32 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b93b367..1b4bc85 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,9 @@ IMPORTANT NOTE: This version only works on CACTI 1.x++! ## Changes +--- develop --- +* issue#233: Rendering issues when the page includes several maps with dropdown + --- 1.6 --- * security#205: weathermap_group_move() uses raw SQL instead of parameterized queries * security#216: Security: defense-in-depth audit findings diff --git a/locales/po/cacti.pot b/locales/po/cacti.pot index 724020b..15b6e6a 100644 --- a/locales/po/cacti.pot +++ b/locales/po/cacti.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Cacti \n" "Report-Msgid-Bugs-To: developers@cacti.net\n" -"POT-Creation-Date: 2026-05-20 10:35-0400\n" +"POT-Creation-Date: 2026-05-26 08:16-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: Cacti Developers >\n" "Language-Team: Cacti Developers \n" @@ -253,8 +253,8 @@ msgstr "" msgid "Weathermap" msgstr "" -#: setup.php:214 weathermap-cacti-plugin.php:476 -#: weathermap-cacti-plugin.php:571 +#: setup.php:214 weathermap-cacti-plugin.php:486 +#: weathermap-cacti-plugin.php:581 msgid "Network Weathermap" msgstr "" @@ -509,8 +509,9 @@ msgstr "" msgid "Normal User" msgstr "" -#: setup.php:689 setup.php:729 weathermap-cacti-plugin.php:386 -#: weathermap-cacti-plugin.php:521 weathermap-cacti-plugin.php:644 +#: setup.php:689 setup.php:729 weathermap-cacti-plugin.php:245 +#: weathermap-cacti-plugin.php:396 weathermap-cacti-plugin.php:531 +#: weathermap-cacti-plugin.php:654 #, php-format msgid "Map for config file: %s" msgstr "" @@ -555,7 +556,7 @@ msgstr "" msgid "View Configuration" msgstr "" -#: setup.php:871 weathermap-cacti-plugin.php:396 +#: setup.php:871 weathermap-cacti-plugin.php:406 msgid "Edit Map" msgstr "" @@ -568,7 +569,7 @@ msgid "Edit Permissions" msgstr "" #: setup.php:892 setup.php:899 weathermap-cacti-plugin-mgmt.php:715 -#: weathermap-cacti-plugin.php:394 +#: weathermap-cacti-plugin.php:404 msgid "Map Settings" msgstr "" @@ -644,7 +645,7 @@ msgstr "" msgid "Group Admin Delete" msgstr "" -#: setup.php:1251 weathermap-cacti-plugin.php:722 +#: setup.php:1251 weathermap-cacti-plugin.php:732 msgid "Local Documentation" msgstr "" @@ -1347,7 +1348,7 @@ msgstr "" msgid "Create Options" msgstr "" -#: weathermap-cacti-plugin-mgmt.php:1232 weathermap-cacti-plugin.php:723 +#: weathermap-cacti-plugin-mgmt.php:1232 weathermap-cacti-plugin.php:733 msgid "New Map" msgstr "" @@ -1737,79 +1738,84 @@ msgstr "" msgid "You must include a Map File name to Create" msgstr "" -#: weathermap-cacti-plugin.php:393 weathermap-cacti-plugin.php:400 +#: weathermap-cacti-plugin.php:252 +#, php-format +msgid "Network Weathermap named \"%s\"" +msgstr "" + +#: weathermap-cacti-plugin.php:403 weathermap-cacti-plugin.php:410 msgid "Return to Main Page" msgstr "" -#: weathermap-cacti-plugin.php:395 +#: weathermap-cacti-plugin.php:405 msgid "Map Permissions" msgstr "" -#: weathermap-cacti-plugin.php:414 weathermap-cacti-plugin.php:667 +#: weathermap-cacti-plugin.php:424 weathermap-cacti-plugin.php:677 msgid "This map hasn't been created yet." msgstr "" -#: weathermap-cacti-plugin.php:446 +#: weathermap-cacti-plugin.php:456 msgid "Manage Maps" msgstr "" -#: weathermap-cacti-plugin.php:480 +#: weathermap-cacti-plugin.php:490 #, php-format msgid "Network Weathermaps [ %sAutomatically Cycle%s ]" msgstr "" -#: weathermap-cacti-plugin.php:529 +#: weathermap-cacti-plugin.php:539 msgid "(thumbnail for map not created yet)" msgstr "" -#: weathermap-cacti-plugin.php:533 +#: weathermap-cacti-plugin.php:543 msgid "(Live View)" msgstr "" -#: weathermap-cacti-plugin.php:542 weathermap-cacti-plugin.php:697 +#: weathermap-cacti-plugin.php:552 weathermap-cacti-plugin.php:707 msgid "You Have No Maps" msgstr "" -#: weathermap-cacti-plugin.php:545 +#: weathermap-cacti-plugin.php:555 #, php-format msgid "To add a map to the schedule, go to the %s Manage...Weathermaps page %s and add one." msgstr "" -#: weathermap-cacti-plugin.php:573 +#: weathermap-cacti-plugin.php:583 msgid "Network Weathermaps" msgstr "" -#: weathermap-cacti-plugin.php:594 +#: weathermap-cacti-plugin.php:604 #, php-format msgid "Showing %s %s of %s %s. Cycling all available maps in this group." msgstr "" -#: weathermap-cacti-plugin.php:596 +#: weathermap-cacti-plugin.php:606 #, php-format msgid "Showing %s %s of %s %s. Cycling all available maps." msgstr "" -#: weathermap-cacti-plugin.php:718 +#: weathermap-cacti-plugin.php:728 #, php-format msgid "Powered by %s PHP Weathermap Version %s %s" msgstr "" -#: weathermap-cacti-plugin.php:721 +#: weathermap-cacti-plugin.php:731 msgid "Go to the Map Management page" msgstr "" -#: weathermap-cacti-plugin.php:721 +#: weathermap-cacti-plugin.php:731 msgid "Weathermap Management" msgstr "" -#: weathermap-cacti-plugin.php:788 +#: weathermap-cacti-plugin.php:798 msgid "Weathermap Filter" msgstr "" -#: weathermap-cacti-plugin.php:797 +#: weathermap-cacti-plugin.php:807 msgid "Map to View" msgstr "" -#: weathermap-cacti-plugin.php:904 +#: weathermap-cacti-plugin.php:914 msgid "All Maps" msgstr "" diff --git a/weathermap-cacti-plugin.php b/weathermap-cacti-plugin.php index 5db6608..fcab853 100644 --- a/weathermap-cacti-plugin.php +++ b/weathermap-cacti-plugin.php @@ -242,12 +242,22 @@ $guid = $map['filehash']; if ($maptitle == '') { - $maptitle = 'Map for config file: ' . $map['configfile']; + $maptitle = __esc('Map for config file: %s', $map['configfile']); } - printf('%sNetwork Weathermap named "%s"%s%s%s', - $maptitle, $maptitle, $linkurl, $thumburl, $bigurl, $config['url_path'], $guid); - print "\n"; + print ''; + + printf('%s', $maptitle); + + printf('' . __('Network Weathermap named "%s"', $maptitle) . ' + %s + + + %s%s + ', + $linkurl, $thumburl, $bigurl, $config['url_path'], $guid); + + print PHP_EOL; } } @@ -402,7 +412,7 @@ function weathermap_singleview($mapid) { } print '
'; - print '
' . html_escape($maptitle) . '
'; + print '
' . $maptitle . '
'; print '
'; print ''; From 3a3b55ccc9c2051f6f866f2e5180f1f320998cb2 Mon Sep 17 00:00:00 2001 From: TheWitness Date: Tue, 26 May 2026 08:21:37 -0400 Subject: [PATCH 2/3] fix: Updating workflow version --- .github/workflows/plugin-ci-workflow.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/plugin-ci-workflow.yml b/.github/workflows/plugin-ci-workflow.yml index e806000..1a67efe 100644 --- a/.github/workflows/plugin-ci-workflow.yml +++ b/.github/workflows/plugin-ci-workflow.yml @@ -72,7 +72,7 @@ jobs: path: cacti/plugins/weathermap - name: Install PHP ${{ matrix.php }} - uses: shivammathur/setup-php@v2 + uses: shivammathur/setup-php@v2.37.1 with: php-version: ${{ matrix.php }} extensions: intl, mysql, gd, ldap, gmp, xml, curl, json, mbstring From 0aff317529589a6f29a84a944ee0a0199a4d10cf Mon Sep 17 00:00:00 2001 From: TheWitness Date: Tue, 26 May 2026 08:23:09 -0400 Subject: [PATCH 3/3] fix: Revert version change, its GitHub again --- .github/workflows/plugin-ci-workflow.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/plugin-ci-workflow.yml b/.github/workflows/plugin-ci-workflow.yml index 1a67efe..e806000 100644 --- a/.github/workflows/plugin-ci-workflow.yml +++ b/.github/workflows/plugin-ci-workflow.yml @@ -72,7 +72,7 @@ jobs: path: cacti/plugins/weathermap - name: Install PHP ${{ matrix.php }} - uses: shivammathur/setup-php@v2.37.1 + uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php }} extensions: intl, mysql, gd, ldap, gmp, xml, curl, json, mbstring