Error while creating Share on federated Instance

This is a bug. First attempt of support about it was made in June 2022 Link creation error on federated shared folder

I am facing this myself. This happens when:

Site A and Site B are federated (and any of those uses a php other than 7.4)
Site A shares a folder/doc with Site B, Site B tries to reshare using public link or even resharing to it’s local users, gets an error.

Site B Using NC 26.0.3 on ubuntu with php 8.0.29 gives me this error:

Exception: call_user_func_array(): Argument #1 ($callback) must be a valid callback, class OCA\Files_Sharing\External\Storage does not have a method "getShareId" in file '/var/www/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php' line 524
/var/www/nextcloud/lib/private/AppFramework/App.php - line 183:

OC\AppFramework\Http\Dispatcher->dispatch()

/var/www/nextcloud/lib/private/Route/Router.php - line 315:

OC\AppFramework\App::main()

/var/www/nextcloud/ocs/v1.php - line 64:

OC\Route\Router->match()

/var/www/nextcloud/ocs/v2.php - line 23:

require_once("/var/www/nextcloud/ocs/v1.php")

Causado por TypeError: call_user_func_array(): Argument #1 ($callback) must be a valid callback, class OCA\Files_Sharing\External\Storage does not have a method "getShareId"
/var/www/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php - line 524:

call_user_func_array()

<<closure>>

OC\Files\Storage\Wrapper\Wrapper->__call()

/var/www/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php - line 524:

call_user_func_array()

/var/www/nextcloud/lib/private/Share20/Manager.php - line 676:

OC\Files\Storage\Wrapper\Wrapper->__call()

/var/www/nextcloud/lib/private/Share20/Manager.php - line 766:

OC\Share20\Manager->setLinkParent()

/var/www/nextcloud/apps/files_sharing/lib/Controller/ShareAPIController.php - line 720:

OC\Share20\Manager->createShare("* sensiti ... *")

/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php - line 230:

OCA\Files_Sharing\Controller\ShareAPIController->createShare("* sensiti ... *")

/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php - line 137:

OC\AppFramework\Http\Dispatcher->executeController()

/var/www/nextcloud/lib/private/AppFramework/App.php - line 183:

OC\AppFramework\Http\Dispatcher->dispatch()

/var/www/nextcloud/lib/private/Route/Router.php - line 315:

OC\AppFramework\App::main()

/var/www/nextcloud/ocs/v1.php - line 64:

OC\Route\Router->match()

/var/www/nextcloud/ocs/v2.php - line 23:

require_once("/var/www/nextcloud/ocs/v1.php")

Using a docker container from a version that has php 7.4 does solve the issue but, the vulnerabilities that come with downgrading are not worth it for my company.