Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing upgrade elements #290

Open
dereuromark opened this issue Aug 23, 2024 · 4 comments
Open

Missing upgrade elements #290

dereuromark opened this issue Aug 23, 2024 · 4 comments

Comments

@dereuromark
Copy link
Member

dereuromark commented Aug 23, 2024

Just adding them as note for now, if someone wants to tackle those

 use Cake\Routing\RouteBuilder;
 
-Router::prefix('Admin', function (RouteBuilder $routes) {
+$routes->prefix('Admin', function (RouteBuilder $routes) {
 	$routes->plugin('Management', function (RouteBuilder $routes) {
 		$routes->fallbacks();
 	});
 });
 
-Router::plugin('Management', function (RouteBuilder $routes) {
+$routes->plugin('Management', function (RouteBuilder $routes) {
 	$routes->fallbacks();
 });

for plugin routes.php files


if ($this->RequestHandler->prefers('rss'))

replacement

@dereuromark
Copy link
Member Author

-$this->set('_serialize', 'result');
+$this->viewBuilder()->setOption('serialize', 'result');

as well as

-TableRegistry::get()
+TableRegistry::getTableLocator()->get()

also was sth that needed to be done manually it seems.

@LordSimal
Copy link
Contributor

LordSimal commented Aug 24, 2024

I think the recommended way to fetch table instances is via the LocatorAwareTrait, not directly from the TableRegistry, right?

If so then we'd need to add the trait via rector as well and replace it with

$this->fetchTable();

@dereuromark
Copy link
Member Author

Sure but for now the quick way would be a simpler replace. Either way works.

@markstory
Copy link
Member

Sure but for now the quick way would be a simpler replace. Either way works.

While the simple replacement isn't the most correct, the upgrade process will be smoother if we had the simple method replacement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants