-
Notifications
You must be signed in to change notification settings - Fork 13
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
fixed: code issues #499
fixed: code issues #499
Conversation
public static function populateModel($attributes) | ||
{ | ||
if ($attributes instanceof AssetDraftRecord) { | ||
$attributes = $attributes->getAttributes(); | ||
} | ||
|
||
$assetData = json_decode($attributes['data'], true); | ||
$fieldContent = isset($assetData['fields']) ? $assetData['fields'] : null; | ||
// $attributes['draftId'] = $attributes['id']; | ||
$attributes['id'] = $attributes['assetId']; | ||
|
||
$attributes = array_diff_key($attributes, array_flip(array('data', 'fields', 'assetId'))); | ||
|
||
$attributes = array_merge($attributes, $assetData); | ||
|
||
$draft = parent::setAttributes($attributes); | ||
|
||
if ($fieldContent) { | ||
$post = array(); | ||
|
||
foreach ($fieldContent as $fieldId => $fieldValue) { | ||
$field = Craft::$app->fields->getFieldById($fieldId); | ||
|
||
if ($field) { | ||
$post[$field->handle] = $fieldValue; | ||
} | ||
} | ||
|
||
$draft->setFieldValues($post); | ||
} | ||
|
||
return $draft; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed due to not being in use.
@@ -73,39 +71,6 @@ public function getHandle() | |||
return $this->getGlobalSet()->handle; | |||
} | |||
|
|||
public static function populateModel($attributes) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not in use
LinkField::class => LinkFieldTranslator::class, | ||
TypedLinkField::class => TypedLinkFieldTranslator::class, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As link field plugin is one renamed to typed link field so removed old one.
case $value instanceof \fruitstudios\linkit\fields\LinkitField: | ||
case $value instanceof \presseddigital\linkit\fields\LinkitField: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ownership of plugin was changed.
The first step for craft 5 upgrade was to resolve issues in plugin code. So we did these changes to fix issues shown by phpstan and now the check is showing this NOTE: I am doing extensive testing to confirm every thing is working as it was prior to these changes. Would be great to have a second pair of eyes too. CC: @MerrittBoydston |
Deployed at https://stage.acclarocraft.com/admin/dashboard |
* fixed: code issues before upgrading to craft5 (#499) * updated: change logs and version bumped * Added: hyper link field support (#504) * Bp/524/verbb navigation plugin support (#506) * fixed: activity log table name issue (#505) * fixed: navigration draft and pgsql migration issue * updated: change log * fixed: dashboard UI issue
Pull Request
Description:
Craft suggested to use php stan before upgrading to craft 5 support and resolve any issues found.
Related Issue(s):
[Cite any related issues or feature requests, using the GitHub issue link.]
Changes Made:
[List the changes made in this pull request to address the issue or implement the feature.]
Added:
Changed:
Deprecated:
Removed:
Fixed:
Security:
Testing:
[Describe the testing performed to ensure the changes are functioning as expected.]
Quality Assurance (QA):
Resources:
Screenshots (if applicable):
[Include any relevant screenshots to visually demonstrate the changes.]
Wrapping up
Checklist:
Additional Notes:
[Include any additional notes, considerations, or context that may be relevant.]