newroco / emlviewer

nextcloud eml viewer plugin
GNU Affero General Public License v3.0
16 stars 3 forks source link

Compatibility to NC 25 #47

Closed meinrecht closed 1 year ago

meinrecht commented 1 year ago

Will there be a release to provide compatibility to NC 25 in the near future?

lucianpricop commented 1 year ago

There will be one, but it seems we'll have to work a bit to update the interface to match the new NC interface.

p-bo commented 1 year ago

Just in case it wasn't noticed - Nextcloud improved policy regarding changes in core to ease app developers in maintaining compatibility with newer Nextcloud versions:

https://help.nextcloud.com/t/new-process-for-documenting-core-code-changes-that-affect-app-developers/149828?u=p-bo

Bockeman commented 1 year ago

If emlviewer is not compatible with NC25 (or any future version), then it should not be advertised as compatible in the text which says something like: "all apps have a compatible version for this upgrade". I've fallen foul of this upgrading to NC 25.0.2 RC3.

lucianpricop commented 1 year ago

If emlviewer is not compatible with NC25 (or any future version), then it should not be advertised as compatible in the text which says something like: "all apps have a compatible version for this upgrade". I've fallen foul of this upgrading to NC 25.0.2 RC3.

That's something you should raise with NC maybe. You can see here https://github.com/newroco/emlviewer/blob/master/appinfo/info.xml that emlviewer states nextcloud min-version="20" max-version="24, so not yet compatible with NC25. Would be helpful to know what problems you encountered with it after upgrade. Thanks

raffaelone commented 1 year ago

Would be helpful to know what problems you encountered with it after upgrade. Thanks

No problem at the moment. Upgrading to NC25 emlviewer works fine.

raffaelone commented 1 year ago

Would be helpful to know what problems you encountered with it after upgrade. Thanks

"Download as PDF" doesn't work. This is the error from the log:

[index] Error: Exception: Class "OCA\EmlViewer\Controller\DataResponse" not found in file '/var/www/nextcloud/apps/emlviewer/lib/Controller/PageController.php' line 227

0. /var/www/nextcloud/lib/private/AppFramework/App.php line 172
   OC\AppFramework\Http\Dispatcher->dispatch()
1. /var/www/nextcloud/lib/private/Route/Router.php line 298
   OC\AppFramework\App::main()
2. /var/www/nextcloud/lib/base.php line 1047
   OC\Route\Router->match()
3. /var/www/nextcloud/index.php line 36
   OC::handleRequest()
rotdrop commented 1 year ago

I'm in the progress of generating a pull request for v25 compatibility. BTW, the error triggered above is just a missing use and caused by a caught exception.

rotdrop commented 1 year ago

After fixing the missing use I am now at a JSON response instead of a download (may I suggest here to maybe switch to some sort of AJAX download in order to catch errors?) which reads:

Error trying to render pdf: HTML contains invalid UTF-8 character(s). See log for further details

So I better get myself another email and retry ...

rotdrop commented 1 year ago

After fixing the missing use I am now at a JSON response instead of a download (may I suggest here to maybe switch to some sort of AJAX download in order to catch errors?) which reads:

Error trying to render pdf: HTML contains invalid UTF-8 character(s). See log for further details

So I better get myself another email and retry ...

Got another email and have the same error. Question now if this is caused by chance because both emails are broken or maybe by an error in one of the dependencies ... BTW, there is nothing in the logs.

rotdrop commented 1 year ago

Ok, so this error is generated by the MPDF package. Maybe the author could comment if this has happened before with older nextcloud version also?

rotdrop commented 1 year ago

The problem is caused by a spurious bytes sequence in front of the HTML string:

239 187 191

This is there in both cases. Maybe problems with the HTML extraction?

rotdrop commented 1 year ago

I think that the following is the problem:

heinecj@nbnmh110:/var/www/html/nextcloud-git-25/apps/emlviewer$ hexdump -c  templates/email_headers.php |head
0000000 357 273 277   <   s   t   y   l   e   >  \n                   /
0000010   *       s   h   o   w       p   r   i   n   t       b   u   t
rotdrop commented 1 year ago

And also

heinecj@nbnmh110:/var/www/html/nextcloud-git-25/apps/emlviewer$ for i in templates/*.php  ; do echo $i ; hexdump -c $i | head -n1 ; done
templates/email_headers.php
0000000 357 273 277   <   s   t   y   l   e   >  \n                   /
templates/emlcontent.php
0000000 357 273 277 357 273 277   <   ?   p   h   p  \n                
templates/error.php
0000000 357 273 277   <   ?   p   h   p       p   r   i   n   t   _   u
templates/index.php
0000000   <   ?   p   h   p  \n   $   e   v   e   n   t   D   i   s   p
templates/printcontent.php
0000000 357 273 277   <   ?   p   h   p       p   r   i   n   t   _   u
rotdrop commented 1 year ago

So this is another issue ...