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

Areablock: Accept array for setDataFromResource() #16773

Open
wants to merge 2 commits into
base: 11.2
Choose a base branch
from

Conversation

blankse
Copy link
Contributor

@blankse blankse commented Mar 13, 2024

Copy link

Review Checklist

  • Target branch (11.2 for bug fixes, others 11.x)
  • Tests (if it's testable code, there should be a test for it - get help)
  • Docs (every functionality needs to be documented, see here)
  • Migration incl. install.sql (e.g. if the database schema changes, ...)
  • Upgrade notes (deprecations, important information, migration hints, ...)
  • Label
  • Milestone

$unserializedData = Tool\Serialize::unserialize($data);
if (is_string($data)) {
$unserializedData = Tool\Serialize::unserialize($data);
} else {
Copy link
Contributor

Choose a reason for hiding this comment

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

We could remove the else and just set $unserializedData = $data as default no?

Copy link
Contributor Author

@blankse blankse Apr 1, 2024

Choose a reason for hiding this comment

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

@mattamon This was possible, but I made it more type safe. It was possible to put a wrong type and nothing happens. I think it should be throw a InvalidArgumentException() like in the renderlet editable.

@blankse blankse force-pushed the areablock_respect_array_data branch from df84246 to ce041a5 Compare April 1, 2024 12:53
Copy link

sonarcloud bot commented Apr 1, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants