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

FIX: Update mouvementstock.class.php #25396

Merged
merged 2 commits into from
Jul 24, 2023
Merged

FIX: Update mouvementstock.class.php #25396

merged 2 commits into from
Jul 24, 2023

Conversation

prietojc
Copy link
Contributor

If first character changes to upper case, some external modules don't show its origin in mouvements.

If first character change to upper case, some external modules don't show its origin in mouvements.
@@ -975,7 +975,7 @@ public function get_origin($origin_id, $origin_type)
if ($origin_type) {
// Separate originetype with "@" : left part is class name, right part is module name
$origin_type_array = explode('@', $origin_type);
$classname = ucfirst($origin_type_array[0]);
$classname = $origin_type_array[0];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Class name should start with uppercase.
Contact, Warehouse, User, ...
This may generates a lot of trouble if classname is only contact, warehouse, user...

Copy link
Contributor Author

@prietojc prietojc Jul 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All right I agree, but uppercase is already done on line 982...
Module name and URL use to be in lowercase , which is the problem I wanted to correct.
I propose a new commint more simple

@eldy eldy added the PR to fix - See feedback in comments PR needs to be fixed to be integrated (some comments should describes the fix to do) label Jul 23, 2023
More elegant.
We don't need to change to upper case (line 978) and then to lower case (line 980). It is only necessary when creating a new class (line 983)
The module name and url are in lower case.
@eldy eldy merged commit f4cec52 into Dolibarr:16.0 Jul 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR to fix - See feedback in comments PR needs to be fixed to be integrated (some comments should describes the fix to do)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants