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 HasOneSql::addField() implicit caption #1239

Merged
merged 8 commits into from
Jan 12, 2025
Merged

Conversation

mvorisek
Copy link
Member

@mvorisek mvorisek commented Jan 11, 2025

No description provided.

{
$ourModel = $this->getOurModel();

return preg_replace('~_(' . preg_quote($ourModel->idField, '~') . '|id)$~', '', $this->link);
Copy link
Member Author

@mvorisek mvorisek Jan 11, 2025

Choose a reason for hiding this comment

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

Introduced in e49806f, improved in 10b7ab1

I belive we should strip "our field id" as "their reference name" might strip the whole title/name.

@mvorisek mvorisek requested a review from DarkSide666 January 12, 2025 00:10
$analysingTheirField = $analysingTheirModel->getField($theirFieldName);
$defaults['type'] ??= $analysingTheirField->type;
$defaults['enum'] ??= $analysingTheirField->enum;
$defaults['values'] ??= $analysingTheirField->values;
$defaults['caption'] ??= $analysingTheirField->caption;
$defaults['caption'] ??= $this->getOurFieldCaptionWithoutReferenceSuffix($analysingTheirModel) . ' ' . $analysingTheirField->getCaption();
Copy link
Member Author

Choose a reason for hiding this comment

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

@mvorisek mvorisek added the MAJOR label Jan 12, 2025
@mvorisek mvorisek changed the title Improve HasOneSql::addField() implicit caption Fix HasOneSql::addField() implicit caption Jan 12, 2025
@mvorisek mvorisek marked this pull request as ready for review January 12, 2025 01:06
@mvorisek mvorisek force-pushed the improve_hasonesql_caption branch from b135c12 to 9cd1437 Compare January 12, 2025 01:26
@mvorisek mvorisek merged commit 9e200a0 into develop Jan 12, 2025
30 checks passed
@mvorisek mvorisek deleted the improve_hasonesql_caption branch January 12, 2025 09:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant