Skip to content

Fix HasOneSql::addField() implicit caption#1239

Merged
mvorisek merged 8 commits intodevelopfrom
improve_hasonesql_caption
Jan 12, 2025
Merged

Fix HasOneSql::addField() implicit caption#1239
mvorisek merged 8 commits intodevelopfrom
improve_hasonesql_caption

Conversation

@mvorisek
Copy link
Copy Markdown
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
Copy Markdown
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
$defaults['enum'] ??= $analysingTheirField->enum;
$defaults['values'] ??= $analysingTheirField->values;
$defaults['caption'] ??= $analysingTheirField->caption;
$defaults['caption'] ??= $this->getOurFieldCaptionWithoutReferenceSuffix($analysingTheirModel) . ' ' . $analysingTheirField->getCaption();
Copy link
Copy Markdown
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
@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

Development

Successfully merging this pull request may close these issues.

1 participant