News: Argument 1 passed to OCA\\News\\Db\\Folder::setLastModified() must be of the type integer or null, string given, called in apps/news/lib/Db/NewsMapper.php on line 44

Created on 15 Oct 2018  路  10Comments  路  Source: nextcloud/news

Explain the Problem

What problem did you encounter?
I Couldn't add new feeds after update to the last version: nextcloud gave an error stating to look at the log file

This happened after updating Nextcloud from 13 to 14 and updating to php7.2 (not sure about who is responsible here...)

System Information

  • News app version: 13.0.2
  • Nextcloud version: 14.0.3
  • PHP version: 7.2

Contents of nextcloud/data/nextcloud.log

{"reqId":"9pN2xMFIaTwix71v1Uty","level":3,"time":"2018-10-15T08:02:42+00:00","remoteAddr":"192.168.0.1","user":"jean-louis","app":"index","method":"POST","url":"/nextcloud\/apps\/news\/folders","message":{"Exception":"TypeError","Message":"Argument 1 passed to OCA\\News\\Db\\Folder::setLastModified() must be of the type integer or null, string given, called in /nextcloud\/apps\/news\/lib\/Db\/NewsMapper.php on line 44","Code":0,"Trace":[{"file":"/nextcloud\/apps\/news\/lib\/Db\/NewsMapper.php","line":44,"function":"setLastModified","class":"OCA\\News\\Db\\Folder","type":"->","args":["1539590562136518"]},{"file":"/nextcloud\/apps\/news\/lib\/Service\/FolderService.php","line":95,"function":"insert","class":"OCA\\News\\Db\\NewsMapper","type":"->","args":[{"id":null,"__class__":"OCA\\News\\Db\\Folder"}]},{"file":"/nextcloud\/apps\/news\/lib\/Controller\/FolderController.php","line":94,"function":"create","class":"OCA\\News\\Service\\FolderService","type":"->","args":["Videos","jean-louis"]},{"file":"/public_html\/nextcloud\/lib\/private\/AppFramework\/Http\/Dispatcher.php","line":166,"function":"create","class":"OCA\\News\\Controller\\FolderController","type":"->","args":["Videos"]},{"file":"/public_html\/nextcloud\/lib\/private\/AppFramework\/Http\/Dispatcher.php","line":99,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[{"__class__":"OCA\\News\\Controller\\FolderController"},"create"]},{"file":"/nextcloud\/lib\/private\/AppFramework\/App.php","line":118,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[{"__class__":"OCA\\News\\Controller\\FolderController"},"create"]},{"file":"/nextcloud\/lib\/private\/AppFramework\/Routing\/RouteActionHandler.php","line":47,"function":"main","class":"OC\\AppFramework\\App","type":"::","args":["OCA\\News\\Controller\\FolderController","create",{"__class__":"OC\\AppFramework\\DependencyInjection\\DIContainer"},{"_route":"news.folder.create"}]},{"function":"__invoke","class":"OC\\AppFramework\\Routing\\RouteActionHandler","type":"->","args":[{"_route":"news.folder.create"}]},{"file":"/nextcloud\/lib\/private\/Route\/Router.php","line":297,"function":"call_user_func","args":[{"__class__":"OC\\AppFramework\\Routing\\RouteActionHandler"},{"_route":"news.folder.create"}]},{"file":"/nextcloud\/lib\/base.php","line":987,"function":"match","class":"OC\\Route\\Router","type":"->","args":["\/apps\/news\/folders"]},{"file":"/nextcloud\/index.php","line":42,"function":"handleRequest","class":"OC","type":"::","args":[]}],"File":"/nextcloud\/apps\/news\/lib\/Db\/Folder.php","Line":113,"CustomMessage":"--"},"userAgent":"Mozilla\/5.0 (X11; Linux x86_64; rv:60.0) Gecko\/20100101 Firefox\/60.0","version":"14.0.3.0"}

POSSIBLE FIX?

I could dirty fix it by changing /nextcloud/apps/news/lib/Utility/Time.php line 27 from

return ($secs . substr($millisecs, 2, 6);

into:

return (int)($secs . substr($millisecs, 2, 6));

Not sure if it's safe...

stale

Most helpful comment

@Grotax
Guys this is my favorite nextcloud apps, thank you so much for it. Take all the time you need for the release. Whoever want it faster can change 6 character on a file to fix it :)

All 10 comments

Duplicate of #350 fixed in #355

@Grotax so, why the maintainer has not released a new version with bug fixes?

Well the news app currently has no official maintainer as you can read in the readme.
However there are still people that are able to release a new version. But creating a release takes time and people tend to be busy. If I could I would release it right now but in lack of the signing key and the proper permissions I can't. So I would suggest to wait until it's done.

@Grotax I see the attitude to this plugin in general. Leaving the latest version of the one that is non-working is the height of devil-may-care attitude.

I see you want to take up the mantle of maintainer cause you know how to do it better. That's great! If you make some pull requests fixing issues we'll have you added to the news team in no time.

@SMillerDev Issue already fixed in master branch. I told about new release (13.0.3).
And PHP not my preferred language. I just a user of Nextcloud

@CannyFoxx Look we all would like to have a new release but just because you want something it's not going to happen faster and I know that sucks. But especially in the world of free software you will encounter some projects where you will need some patience. Complaining will in not cause a speed up.
If you need a fix right now you could:
A) downgrade manually
or
B) apply the patch on your local version
If you can't or don't want to do that you will have to wait.

@Grotax
Guys this is my favorite nextcloud apps, thank you so much for it. Take all the time you need for the release. Whoever want it faster can change 6 character on a file to fix it :)

@metaphys thx for the fix

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

Was this page helpful?
0 / 5 - 0 ratings