yllen / pdf

GNU Affero General Public License v3.0
14 stars 14 forks source link

Print to PDF not working #27

Open gkukovacec opened 1 year ago

gkukovacec commented 1 year ago

Hi,

I get this error when debug mode is turned on:

PHP Notice (8): Undefined index: container in /home/XXXXXXXXXX/public_html/glpi/plugins/pdf/inc/common.class.php at line 517

And then if fails with "Error - Failed operation" popup.

Same on assets, tickets...

GLPI version is 10.0.3 Plugin version is 2.1.0

Please help!

Thanks, Goran

gkukovacec commented 1 year ago

Update: print working from "Print to PDF" from left menu on open ticket, but not from Actions menu!

yllen commented 1 year ago

There is no container index in the common.class. Can you give me the complete error in file/_logs/php-error.log?

From Actions menu, no problem for me, i can print in PDF several computers. Have you an error?

gkukovacec commented 1 year ago

Hi Yllen, thanks for your feedback.

As I have said, Print to PDF works from menu on the left in the ticket, but not from action button.

Here is log entry you've requested:

[2022-11-02 10:45:58] glpiphplog.NOTICE: *** PHP Notice (8): Undefined index: container in /home/getimin5/public_html/glpi/plugins/pdf/inc/common.class.php at line 517 Backtrace : src/MassiveAction.php:904 PluginPdfCommon::showMassiveActionsSubForm() ajax/dropdownMassiveAction.php:53 MassiveAction->showSubForm()

Thank you!

Goran

yllen commented 1 year ago

I made several tests and container is always defined

For ticket => all OK MassiveAction Object ( [POST] => Array ( [action] => DoIt [container] => massformTicket

For computer => all OK MassiveAction Object ( [POST] => Array ( [action] => DoIt [container] => massformComputer I can't correct an issue if i can't reproduce it.

which parameters have you checked for ticketd in your pdf printing preferences(in my setting)?

gkukovacec commented 1 year ago

Hi, I have chosen Tickets and Items.

image

If required, I can provide access, just let me know how to PM credentials to you.

Thanks for your time!

Goran

yllen commented 1 year ago

Massive actions are defined in your settings not in the item. So, post your settings for ticket item

gkukovacec commented 1 year ago

I'm sorry, I'm noob here... please let me know what exactly. Thanks, Goran

yllen commented 1 year ago

image image

gkukovacec commented 1 year ago

I have selected Items there, too.

image

Still the same: Uncaught Exception TypeError: Argument 1 passed to Toolbox::stripTags() must be of the type string, null given, called in /home/getimin5/public_html/glpi/plugins/pdf/inc/item_ticket.class.php on line 122 in /home/getimin5/public_html/glpi/src/Toolbox.php at line 3109

gkukovacec commented 1 year ago

Would you like me to send you Superadmin acconut?

yllen commented 1 year ago

This error was already corrected. Duplicate #26

gkukovacec commented 1 year ago

Great!

How do I apply it?

Thanks!

Goran

yllen commented 1 year ago

You apply the correction https://github.com/yllen/pdf/commit/021a46a8daa29377763d866f19fb4b2af63d8a9d

gkukovacec commented 1 year ago

I have applied the correction, I can confirm that printing now works if Items are selected.

Printing from Action button still does not work, fails with the same error as in initial post.

PHP Notice (8): Undefined index: container in /home/getimin5/public_html/glpi/plugins/pdf/inc/common.class.php at line 517

Please advise. Thanks, Goran

yllen commented 1 year ago

OK, so corrected for items. Which fields of which item do you want to print? Can you give me the error in glpi (php-ellor.log)?

I think one of the field is missing and i must to protect it, like for ticket's item

yllen commented 10 months ago

No news. I close

gkukovacec commented 10 months ago

Still not working though Pozdrav, Goran

Goran Kukovačec, dipl. ing. el. | +385 91 10 11 696<tel:+385%2091%2010%2011%20696> | Getim d.o.o. |www.getim.hrhttp://www.getim.hr/

On 07.11.2023., at 16:37, yllen @.***> wrote:



No news. I close

— Reply to this email directly, view it on GitHubhttps://github.com/yllen/pdf/issues/27#issuecomment-1798909358, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ABW6F7QMBCOYZDDPHRX4IPDYDJITFAVCNFSM6AAAAAARR4SPZ6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTOOJYHEYDSMZVHA. You are receiving this because you authored the thread.Message ID: @.***>

yllen commented 10 months ago

Can you reply to my questions? Which fields of which item do you want to print? Can you give me the error in glpi (php-error.log)?

vb73 commented 9 months ago

Hi,

I seem to have almost the same problem : I can perform a ticket PDF export in the left menu, but not in the "action menu".

When I choose "Impression PDF" from the action menu : image

I've got this popup : image

And when I hit "Envoyer" (send), i've got a 404 error : https://glpi.domain.com/plugins/pdf/front/export.massive.php

Log in php-errors.log :

[2023-12-11 14:14:45] glpiphplog.WARNING: *** PHP Warning (2): Undefined array key "container" in /var/web/glpi/marketplace/pdf/inc/common.class.php at line 522 Backtrace : src/MassiveAction.php:908 PluginPdfCommon::showMassiveActionsSubForm() ajax/dropdownMassiveAction.php:53 MassiveAction->showSubForm() public/index.php:82 require()

In my preferences, only the item "Ticket" is ticked : image

I'm running GLPI 10.0.10 and PDF plugin 3.0.0

I'm available if you need more information, Vincent.

andrepetinga commented 4 months ago

Hello. I have the same problem, using GLPI 10.0.12 and PDF plugin 3.0.0 If I use the actions button, when I press the Printo to PDF, using debug mode, the error shows up even before pressing the "Submit button.

image

PS: This was tested opening a ticket, and the plugin only has the "Ticket" option selected

laurixia commented 3 months ago

Any news on this last issue? It also fails me when I select multiple items and print to pdf.

pdf1 pdf2 pdf3