ocsms icon indicating copy to clipboard operation
ocsms copied to clipboard

Compatibility with NextCloud 26

Open cyrilst opened this issue 1 year ago • 9 comments

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 avatar Mar 22 '23 10:03 cyrilst

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.

cyrilst avatar Mar 22 '23 14:03 cyrilst

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.

jimbolaya avatar May 01 '23 17:05 jimbolaya

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.

cyrilst avatar May 01 '23 19:05 cyrilst

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.

jimbolaya avatar May 01 '23 20:05 jimbolaya

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.

cyrilst avatar May 01 '23 20:05 cyrilst

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

jimbolaya avatar May 02 '23 11:05 jimbolaya

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.

palouf34 avatar May 04 '23 14:05 palouf34

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.

cyrilst avatar May 05 '23 09:05 cyrilst

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

BrunoTouze avatar May 06 '23 10:05 BrunoTouze