Skip to content

Conversation

@DEV2DEV-DE
Copy link
Contributor

The folder name for widgets changed from 'Modules' to 'Widgets' in Zabbix 7

@shrank shrank merged commit c950f1f into shrank:main Dec 17, 2024
@shrank
Copy link
Owner

shrank commented Dec 17, 2024

@DEV2DEV-DE I tried to load it in zabbix 7.2 but I keep getting an error. I looked at different built-in widgets and couldn't figure out how to make it work.

Does it work for you? What version are you running?

here is the error I'm getting:

Uncaught TypeError: CWidgetFieldTextAreaView::__construct(): Argument #1 ($field) must be of type Zabbix\Widgets\Fields\CWidgetFieldTextArea, null given, called in /usr/share/zabbix/modules/html_widget/views/widget.edit.php on line 11 and defined in /usr/share/zabbix/include/classes/html/widgets/fields/CWidgetFieldTextAreaView.php:24
Stack trace:
#0 /usr/share/zabbix/modules/html_widget/views/widget.edit.php(11): CWidgetFieldTextAreaView->__construct()
#1 /usr/share/zabbix/include/classes/mvc/CView.php(128): include('...')
#2 /usr/share/zabbix/include/classes/core/ZBase.php(722): CView->getOutput()
#3 /usr/share/zabbix/include/classes/core/ZBase.php(646): ZBase->processResponseFinal()
#4 /usr/share/zabbix/include/classes/core/ZBase.php(228): ZBase->processRequest()
#5 /usr/share/zabbix/include/config.inc.php(20): ZBase->run()
#6 /usr/share/zabbix/zabbix.php(17): require_once('...')
#7 {main}
  thrown in /usr/share/zabbix/include/classes/html/widgets/fields/CWidgetFieldTextAreaView.php on line 24

@DEV2DEV-DE
Copy link
Contributor Author

Works for me with Zabbix 7.0.0.
I have another server running 7.0.6. I will try to get it working there.

@DEV2DEV-DE
Copy link
Contributor Author

DEV2DEV-DE commented Dec 17, 2024

Zabbix 7.0.6: Fetched your version 1.0 and changed the 2 files 'by hand' (replaced 'Modules' with 'Widgets'):

image

@DEV2DEV-DE
Copy link
Contributor Author

Maybe there are additional changes needed for 7.2?

@DEV2DEV-DE
Copy link
Contributor Author

DEV2DEV-DE commented Dec 17, 2024

Seems you are still using folder 'modules'.
In Zabbix 7 the widgets have to be saved in folder 'widgets'.

@shrank
Copy link
Owner

shrank commented Dec 18, 2024

The manual for version 7.2 specifically says to put them into modules/your-module/
https://www.zabbix.com/documentation/current/en/manual/extensions/frontendmodules

I changed the namespace back and it works just fine on 7.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants