nextcloud / ocsms

📱 Nextcloud/ownCloud PhoneSync server application
https://play.google.com/store/apps/details?id=fr.unix_experience.owncloud_sms
GNU Affero General Public License v3.0
189 stars 52 forks source link

Compatibility with NextCloud 26 #353

Open cyrilst opened 1 year ago

cyrilst commented 1 year ago

Steps to reproduce

1.Upgrade to NextCloud 26.0.0

Expected behaviour

ocsms should work

Actual behaviour

it's impossible to even activate ocsms

Server configuration

Nextcloud/ownCloud version: 26.0.0

PHP version: 8.1.13

HTTPd server: apache

Database engine & version: MariaDB 10.6.11

Logs

Exception: Class "OCP\AppFramework\Db\Mapper" not found in file '/path/to/nextcloud/apps/ocsms/db/conversationstatemapper.php' line 21
cyrilst commented 1 year ago

I have a fix. In these files:

Change use \OCP\AppFramework\Db\Mapper; to use \OCP\AppFramework\Db\QBMapper; Change class NameOfTheMapper extends Mapper to class NameOfTheMapper extends QBMapper

That should be enough.

jimbolaya commented 1 year ago

Is this a php 8.1 related change? I tried making the change in NC 25 with no luck, but I'm also only running php 8.0.

cyrilst commented 1 year ago

I don't think it's related to a specific version of php. I recently upgraded to php 8.2 and the fix still works. If you just change Mapper to QBMapper in the 2 lines in each of the 3 files, it should be OK, even in php 8.0.

jimbolaya commented 1 year ago

OK, thanks. It must be a NC 25 vs 26 issue. I still get a "Please select a conversation from the list to load it." and the rest of the page is blank.

I'll try again in NC 26 when I get there.

cyrilst commented 1 year ago

Oh, maybe you need to have a look at this : https://github.com/nextcloud/ocsms/issues/347 I had to apply the change proposed by adi2k5 when upgrading from NC 24 to NC 25.

jimbolaya commented 1 year ago

That's the ticket. Thanks. I would have stumbled on that eventually, but you saved me a ton of time and I appreciate that.

palouf34 commented 1 year ago

I have a fix. In these files:

  • /path/to/nextcloud/apps/ocsms/db/conversationstatemapper.php
  • /path/to/nextcloud/apps/ocsms/db/smsmapper.php
  • /path/to/nextcloud/apps/ocsms/db/configmapper.php

Change use \OCP\AppFramework\Db\Mapper; to use \OCP\AppFramework\Db\QBMapper; Change class NameOfTheMapper extends Mapper to class NameOfTheMapper extends QBMapper

That should be enough.

Hi,

I have made the modification on the three files requested, but I still have the error.

I can't find the file I need to modify for the class.

The only difference is that I use postgresql as my database.

cyrilst commented 1 year ago

I wasn't clear enough: the 2 changes are in each of the 3 files. And in each file you must search for class <something> extends Mapper. NameOfTheMapper is a placeholder.

BrunoTouze commented 1 year ago

Hi, Like Jimbolaya i can't see any sms (just "Please select a conversation from the list to load it."). I've add the two lines in the css/style.php (overflow-x and overflow-y) without success. Tables are well filled by the Nextcloud SMS app of FDROID. Is somebody can show me his full app-navigation section in style.css ?

Nextcloud 26.0.1 Apache 2.4.56-1 Mariadb 10.5.19 php8.2