Skip to content

Mutated camel2words broke existing apps #19467

@Eseperio

Description

@Eseperio

The change introduced in cf16004 has broke all our REST apps which use v1/... as endpoint since we were using camel2words to build url patterns. The same will happen in all other apps which use Inflector::camel2words and Inflector::slug to generate url or tokens.

A change to a so older function should be done with a parameter or a warning in upgrade notes. I suggest adding a warning to upgrade notes.

What steps will reproduce the problem?

Having a module named v1, create patterns for url from classes namespaces and the use of Inflector::camel2words and Inflector::slug to convert, i.e; v1/customerOrders/index to v1/customer-orders/index.

What is the expected result?

v1/default/index returns DefaultController::actionIndex

What do you get instead?

The action is not being resolved by real controller, because the patterns generated are v-1/customer-orders/index, but only fails on POST requests.

{"name":"Method Not Allowed","message":"Method Not Allowed. This URL can only handle the following request methods: GET, HEAD.","code":0,"status":405,"type":"yii\\web\\MethodNotAllowedHttpException"}

Additional info

Q A
Yii version 2.0.45
PHP version 8.0
Operating system MacOS

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions