ouun / zammad-wp

Zammad WordPress integration
GNU General Public License v2.0
27 stars 5 forks source link

I cant make it work. #42

Closed F3rr021 closed 1 month ago

F3rr021 commented 1 month ago

I have installed the plugin in WordPress, I have entered the instructions in wp-config.php, but I cannot connect even with the forms and the zammad chat does not appear either. I have the installation on my own VPS and zammad runs under docker-compose. Zammad works well, you can create tickets in it, but the connection in wordpress could not be achieved. I want to know if this plugin works or if another option should be done.

Zammad 6.2.0 Plugin Lastest

F3rr021 commented 1 month ago

I have installed the plugin in WordPress, I have entered the instructions in wp-config.php, but I cannot connect even with the forms and the zammad chat does not appear either. I have the installation on my own VPS and zammad runs under docker-compose. Zammad works well, you can create tickets in it, but the connection in wordpress could not be achieved. I want to know if this plugin works or if another option should be done.

Zammad 6.2.0 Plugin Lastest

i have this errors

[16-Jul-2024 16:53:37 UTC] PHP Fatal error: Uncaught Error: Class "ZammadWp\Zammad" not found in /home/eajijifb/public_html/wp-content/plugins/zammad-wp-master/includes/functions/hf-plugin-integration.php:29 Stack trace:

0 /home/eajijifb/public_html/wp-includes/class-wp-hook.php(324): {closure}(Array, '$index')

1 /home/eajijifb/public_html/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters('', Array)

2 /home/eajijifb/public_html/wp-includes/plugin.php(517): WP_Hook->do_action(Array)

3 /home/eajijifb/public_html/wp-content/plugins/html-forms/views/tab-actions.php(64): do_action('hf_outputform...', Array, '$index')

4 /home/eajijifb/public_html/wp-content/plugins/html-forms/src/admin/class-admin.php(297): require('/home/eajijifb/...')

5 /home/eajijifb/public_html/wp-includes/class-wp-hook.php(324): HTML_Forms\Admin\Admin->tab_actions(Object(HTML_Forms\Form))

6 /home/eajijifb/public_html/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters('', Array)

7 /home/eajijifb/public_html/wp-includes/plugin.php(517): WP_Hook->do_action(Array)

8 /home/eajijifb/public_html/wp-content/plugins/html-forms/views/page-edit-form.php(57): do_action('hf_admin_output...', Object(HTML_Forms\Form))

9 /home/eajijifb/public_html/wp-content/plugins/html-forms/src/admin/class-admin.php(273): require('/home/eajijifb/...')

10 /home/eajijifb/public_html/wp-content/plugins/html-forms/src/admin/class-admin.php(242): HTML_Forms\Admin\Admin->page_edit_form()

11 /home/eajijifb/public_html/wp-includes/class-wp-hook.php(324): HTML_Forms\Admin\Admin->page_overview('')

12 /home/eajijifb/public_html/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters('', Array)

13 /home/eajijifb/public_html/wp-includes/plugin.php(517): WP_Hook->do_action(Array)

14 /home/eajijifb/public_html/wp-admin/admin.php(259): do_action('toplevel_page_h...')

15 {main}

thrown in /home/eajijifb/public_html/wp-content/plugins/zammad-wp-master/includes/functions/hf-plugin-integration.php on line 29

ouun commented 1 month ago

@F3rr021 just tested it on a freh install and it works as expected. Please go sure that you download the latest release and not just the files from the repository if you are not using Composer. The release files contain a /vendor folder which is required.

Closing this as I expect it to work. If it does not, please feel free to re-open.

F3rr021 commented 1 month ago

Hello, thank you for your response, in addition to what you do with this pluing. But I still have the same problem. I have downloaded from the link you reference, I have the configuration of define('ZAMMAD_URL', 'https://pqrs.importadoraevolucion.com'); define('ZAMMAD_HTTP_TOKEN', 'my token'); and i can see:

Captura de pantalla 2024-07-25 093509 Captura de pantalla 2024-07-25 102718 Captura de pantalla 2024-07-25 102737 Zammad Group
Priority Ticket

Ticket Status Ticket Subject
Message

but when I try to create the ticket using the form it still shows that the url is not defined and hence the other errors. I understand that the connection is fine, because I can see the groups and so on, but when I try to create the ticket from the form, it does not find it. Please, can you help me? the vendor folder is there, I don't use composer.

This is the log error:

[25-Jul-2024 15:45:16 UTC] PHP Fatal error: Uncaught RuntimeException: Missing option "url" in /home/eajijifb/public_html/wp-content/plugins/zammad-wp/vendor/zammad/zammad-api-client-php/src/HTTPClient.php:55 Stack trace:

0 /home/eajijifb/public_html/wp-content/plugins/zammad-wp/vendor/zammad/zammad-api-client-php/src/Client.php(52): ZammadAPIClient\HTTPClient->__construct(Array)

1 /home/eajijifb/public_html/wp-content/plugins/zammad-wp/includes/classes/Zammad.php(73): ZammadAPIClient\Client->__construct(Array)

2 /home/eajijifb/public_html/wp-content/plugins/zammad-wp/includes/classes/Zammad.php(55): ZammadWp\Zammad->client()

3 /home/eajijifb/public_html/wp-content/plugins/zammad-wp/includes/functions/hf-plugin-integration.php(128): ZammadWp\Zammad->__construct(Array)

4 /home/eajijifb/public_html/wp-includes/class-wp-hook.php(324): zammad_hf_process_form_action(Array, Object(HTML_Forms\Submission), Object(HTML_Forms\Form))

5 /home/eajijifb/public_html/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters('', Array)

6 /home/eajijifb/public_html/wp-includes/plugin.php(517): WP_Hook->do_action(Array)

7 /home/eajijifb/public_html/wp-content/plugins/html-forms/src/class-forms.php(300): do_action('hf_process_form...', Array, Object(HTML_Forms\Submission), Object(HTML_Forms\Form))

8 /home/eajijifb/public_html/wp-includes/class-wp-hook.php(324): HTML_Forms\Forms->listen_for_submit('')

9 /home/eajijifb/public_html/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array)

10 /home/eajijifb/public_html/wp-includes/plugin.php(517): WP_Hook->do_action(Array)

11 /home/eajijifb/public_html/wp-settings.php(700): do_action('init')

12 /home/eajijifb/public_html/wp-config.php(96): require_once('/home/eajijifb/...')

13 /home/eajijifb/public_html/wp-load.php(50): require_once('/home/eajijifb/...')

14 /home/eajijifb/public_html/wp-admin/admin-ajax.php(22): require_once('/home/eajijifb/...')

15 {main}

thrown in /home/eajijifb/public_html/wp-content/plugins/zammad-wp/vendor/zammad/zammad-api-client-php/src/HTTPClient.php on line 55

ouun commented 1 month ago

@F3rr021 so this is another error as the one before, isn't it? However I can not reproduce it. Can you try to set your url directly as decribed here: https://github.com/ouun/zammad-wp/issues/28#issuecomment-1691673483

F3rr021 commented 1 month ago

@F3rr021 so this is another error as the one before, isn't it? However I can not reproduce it. Can you try to set your url directly as decribed here: #28 (comment)

I do, but dont know where: i was try on all parts on code. and dont work. And other think, i need to delete the define parts of wp-config.php? Sorry men if im stupid with this.

F3rr021 commented 1 month ago

$this->url = defined('https://pqrs.importadoraevolucion.com') ? ZAMMAD_URL : i change here, and put token on line HTTP_TOKEN to, and now dont show on action-form: Zammad Group Priority Ticket Ticket Status Ticket Subject Message

and error_log show same error:

[25-Jul-2024 20:57:46 UTC] PHP Fatal error: Uncaught RuntimeException: Missing option "url" in /home/eajijifb/public_html/wp-content/plugins/zammad-wp/vendor/zammad/zammad-api-client-php/src/HTTPClient.php:55 Stack trace:

0 /home/eajijifb/public_html/wp-content/plugins/zammad-wp/vendor/zammad/zammad-api-client-php/src/Client.php(52): ZammadAPIClient\HTTPClient->__construct(Array)

1 /home/eajijifb/public_html/wp-content/plugins/zammad-wp/includes/classes/Zammad.php(74): ZammadAPIClient\Client->__construct(Array)

2 /home/eajijifb/public_html/wp-content/plugins/zammad-wp/includes/classes/Zammad.php(56): ZammadWp\Zammad->client()

3 /home/eajijifb/public_html/wp-content/plugins/zammad-wp/includes/functions/hf-plugin-integration.php(31): ZammadWp\Zammad->__construct(Array)

4 /home/eajijifb/public_html/wp-includes/class-wp-hook.php(324): {closure}(Array, 0)

5 /home/eajijifb/public_html/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters('', Array)

6 /home/eajijifb/public_html/wp-includes/plugin.php(517): WP_Hook->do_action(Array)

7 /home/eajijifb/public_html/wp-content/plugins/html-forms/views/tab-actions.php(28): do_action('hf_outputform...', Array, 0)

8 /home/eajijifb/public_html/wp-content/plugins/html-forms/src/admin/class-admin.php(297): require('/home/eajijifb/...')

9 /home/eajijifb/public_html/wp-includes/class-wp-hook.php(324): HTML_Forms\Admin\Admin->tab_actions(Object(HTML_Forms\Form))

10 /home/eajijifb/public_html/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters('', Array)

11 /home/eajijifb/public_html/wp-includes/plugin.php(517): WP_Hook->do_action(Array)

12 /home/eajijifb/public_html/wp-content/plugins/html-forms/views/page-edit-form.php(57): do_action('hf_admin_output...', Object(HTML_Forms\Form))

13 /home/eajijifb/public_html/wp-content/plugins/html-forms/src/admin/class-admin.php(273): require('/home/eajijifb/...')

14 /home/eajijifb/public_html/wp-content/plugins/html-forms/src/admin/class-admin.php(242): HTML_Forms\Admin\Admin->page_edit_form()

15 /home/eajijifb/public_html/wp-includes/class-wp-hook.php(324): HTML_Forms\Admin\Admin->page_overview('')

16 /home/eajijifb/public_html/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters('', Array)

17 /home/eajijifb/public_html/wp-includes/plugin.php(517): WP_Hook->do_action(Array)

18 /home/eajijifb/public_html/wp-admin/admin.php(259): do_action('toplevel_page_h...')

19 {main}

thrown in /home/eajijifb/public_html/wp-content/plugins/zammad-wp/vendor/zammad/zammad-api-client-php/src/HTTPClient.php on line 55

ouun commented 1 month ago

I do, but dont know where: i was try on all parts on code. and dont work. And other think, i need to delete the define parts of wp-config.php? Sorry men if im stupid with this.

Don't worry. You just need some help of someone that knows some coding basics. But this is out of scope of what I can offer for an open source project. A last hint before closing this is, that you should set your url here as a string:

 $this->url = '123456789';

Also do the same for your token. If this solves it, please let me know. Otherise I am sorry as I can not help you further.

F3rr021 commented 1 month ago

Lo hago, pero no sé dónde: lo intenté en todas las partes del código y no funcionó. Y otra cosa, ¿tengo que eliminar las partes definidas de wp-config.php? Lo siento, muchachos, si soy estúpido con esto.

No te preocupes. Solo necesitas la ayuda de alguien que conozca algunos conceptos básicos de codificación. Pero esto está fuera del alcance de lo que puedo ofrecer para un proyecto de código abierto. Un último consejo antes de cerrar esto es que debes configurar tu URL aquí como una cadena:

 $this->url = '123456789';

Haz lo mismo con tu token. Si esto lo resuelve, avísame. De lo contrario, lo siento, pero no puedo ayudarte más.

Thanks men, now works. But i have a lot objets for create on form for pass to zammad ticket. But you helping me a lot. If you now where i find zammad_wp:hf_action:ticket_fields, it find on form of plugin? or on code of zammad.

ouun commented 1 month ago

OK, glad it works now. So we need to find the bug here. Can you please let me know what you changed exactly to get it working? That is of great help.

If you now where i find zammad_wp:hf_action:ticket_fields, it find on form of plugin? or on code of zammad.

You can find the filter here. It is part of the plugin. However you should not hardcode it but use a filter action instead as described in the wiki.

F3rr021 commented 1 month ago

OK, glad it works now. So we need to find the bug here. Can you please let me know what you changed exactly to get it working? That is of great help. I change here: $this->url ='https://pqrs.importadoraevolucion.com'; same for token part.

If you now where i find zammad_wp:hf_action:ticket_fields, it find on form of plugin? or on code of zammad.

You can find the filter here. It is part of the plugin. However you should not hardcode it but use a filter action instead as described in the wiki. I saw that code, and dont move for now. But i saw a: zammad_wp:hf_action:user_fields but dunno how i use that filter, if i use on ibericode plugin, or on my htlm code form. Dunno how use that part. Can you tell me where i use plz.

ouun commented 1 month ago

@F3rr021 you should learn about hooks in WordPress if you want to work with it: https://kinsta.com/blog/wordpress-hooks/#where-to-register-hooks-and-their-functions

F3rr021 commented 1 month ago

Hey me, You have mail, for contact You? Im new on this, and need help for pass objets from form to objets on zammad. If can, and get deal for pay any cost no this. I dont have time now, and need fast that i can.

El lun, 29 de jul. de 2024, 3:56 a. m., Philipp @.***> escribió:

@F3rr021 https://github.com/F3rr021 you should learn about hooks in WordPress if you want to work with it: https://kinsta.com/blog/wordpress-hooks/#where-to-register-hooks-and-their-functions

— Reply to this email directly, view it on GitHub https://github.com/ouun/zammad-wp/issues/42#issuecomment-2255374903, or unsubscribe https://github.com/notifications/unsubscribe-auth/BJEOJYJA4Y3TALLOY2WCOFDZOX7UXAVCNFSM6AAAAABK65YMBWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENJVGM3TIOJQGM . You are receiving this because you were mentioned.Message ID: @.***>

ouun commented 1 month ago

@F3rr021 what is your mail address? I'll get in contact with you.

F3rr021 commented 1 month ago

@.*** that is my email. Ty men.

El mar, 30 de jul. de 2024, 4:17 a. m., Philipp @.***> escribió:

@F3rr021 https://github.com/F3rr021 what is your mail address? I'll get in contact with you.

— Reply to this email directly, view it on GitHub https://github.com/ouun/zammad-wp/issues/42#issuecomment-2257877246, or unsubscribe https://github.com/notifications/unsubscribe-auth/BJEOJYKOBPDQB3HI3BYEPULZO5K3XAVCNFSM6AAAAABK65YMBWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENJXHA3TOMRUGY . You are receiving this because you were mentioned.Message ID: @.***>

F3rr021 commented 1 month ago

Any change to contact you today bro?

El mar, 30 jul 2024 a la(s) 4:17 a.m., Philipp @.***) escribió:

@F3rr021 https://github.com/F3rr021 what is your mail address? I'll get in contact with you.

— Reply to this email directly, view it on GitHub https://github.com/ouun/zammad-wp/issues/42#issuecomment-2257877246, or unsubscribe https://github.com/notifications/unsubscribe-auth/BJEOJYKOBPDQB3HI3BYEPULZO5K3XAVCNFSM6AAAAABK65YMBWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENJXHA3TOMRUGY . You are receiving this because you were mentioned.Message ID: @.***>

-- Cesar Augusto Ortegon R. Ing. Soporte Tecnico Help-Desk. Cali, Colombia.

La información contenida en este e-mail es confidencial y sólo puede ser utilizada por la persona a la cual está dirigida. Si usted no es el receptor autorizado, cualquier retención, difusión, distribución o copia de este mensaje es prohibida y sancionada por la ley. Si por error recibe este mensaje reenvíelo al remitente y elimínelo inmediatamente. Este mensaje ha sido verificado con software antivirus.

F3rr021 commented 1 month ago

Hi men, how re You? Any tiene for help me? Plz

Mi email @.***

El mar, 30 de jul. de 2024, 4:17 a. m., Philipp @.***> escribió:

@F3rr021 https://github.com/F3rr021 what is your mail address? I'll get in contact with you.

— Reply to this email directly, view it on GitHub https://github.com/ouun/zammad-wp/issues/42#issuecomment-2257877246, or unsubscribe https://github.com/notifications/unsubscribe-auth/BJEOJYKOBPDQB3HI3BYEPULZO5K3XAVCNFSM6AAAAABK65YMBWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENJXHA3TOMRUGY . You are receiving this because you were mentioned.Message ID: @.***>