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

Always set currentRecord when initializing widgets #5753

Merged
merged 1 commit into from Feb 6, 2023

Conversation

leofeyer
Copy link
Member

@leofeyer leofeyer commented Feb 2, 2023

First of all, this is not to be mistaken with $objCurrentRecord in the DCA, which we have recently reworked for Contao 5.

Our widgets have a currentRecord property, which is set when they are initialized:

$objWidget = new $strClass($strClass::getAttributesFromDca($arrData, $this->strInputName, $this->varValue, $this->strField, $this->strTable, $this));
$objWidget->xlabel = $xlabel;
$objWidget->currentRecord = $this->intId;

However, we are not doing this everywhere, so sometimes the value is unexpectedly null. This PR fixes that.

@leofeyer leofeyer added the bug label Feb 2, 2023
@leofeyer leofeyer self-assigned this Feb 2, 2023
@leofeyer leofeyer added this to the 4.13 milestone Feb 2, 2023
@leofeyer leofeyer requested a review from a team February 2, 2023 16:30
@leofeyer leofeyer merged commit 7f862df into contao:4.13 Feb 6, 2023
@leofeyer leofeyer deleted the fix/current-record branch February 6, 2023 12:21
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.

None yet

1 participant