-
Notifications
You must be signed in to change notification settings - Fork 3
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: Disallow deleting assets that are used in items #525
fix: Disallow deleting assets that are used in items #525
Conversation
Front-end summary Node 18
|
model/relation/event/processor/ItemDuplicationEventProcessor.php
Outdated
Show resolved
Hide resolved
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.
- New code is covered by tests (if applicable)
- Tests are running successfully (old and new ones) on my local machine (if applicable)
- New code is respecting code style rules
- New code is respecting best practices
- New code is not subject to concurrency issues (if applicable)
- Feature is working correctly on my local machine (if applicable)
- Acceptance criteria are respected
- Pull request title and description are meaningful
…it amount of items when deleting assets
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.
- New code is covered by tests (if applicable)
- Tests are running successfully (old and new ones) on my local machine (if applicable)
- New code is respecting code style rules
- New code is respecting best practices
- New code is not subject to concurrency issues (if applicable)
- Feature is working correctly on my local machine (if applicable)
- Acceptance criteria are respected
- Pull request title and description are meaningful
}); | ||
foreach ($nestedResources as $nestedResource) { | ||
$resource = $this->getOntology()->getResource($nestedResource['id']); | ||
$property = $this->getOntology()->getProperty('http://www.tao.lu/Ontologies/TAOMedia.rdf#RelatedItem'); |
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.
Cant we use this const ? \oat\taoMediaManager\model\relation\repository\rdf\RdfMediaRelationRepository::ITEM_RELATION_PROPERTY
? Just make it public?
} else { | ||
let itemList = haveItemReferences; | ||
if (itemList.length > overloadLimit) { | ||
itemList = haveItemReferences.slice(0, overloadLimit); |
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.
I don't see message saying that there's more items than 15 on this list (and how much), could be handy to make decision what to do next.
Version
There are 0 BREAKING CHANGE, 10 features, 15 fixes |
Missing features
Disallow user from removing assets used in items.
How to test:
Add item relation to media on duplicate item, copy item and delete item
Screen.sharing.-.2025-01-22.3_20_18.PM.mp4
Dependencies
oat-sa/generis#1148
https://github.com/oat-sa/tao-core/pull/4180/files