mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Removed notice-level errors
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@40422 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
c04c8f1a5c
commit
ac29eb5b89
@ -159,6 +159,8 @@ class ComponentSet extends DataObjectSet {
|
||||
* @param array $idList List of IDs.
|
||||
*/
|
||||
function setByIDList($idList) {
|
||||
$has = array();
|
||||
|
||||
// Index current data
|
||||
if($this->items) {
|
||||
foreach($this->items as $item) {
|
||||
@ -172,13 +174,14 @@ class ComponentSet extends DataObjectSet {
|
||||
if($idList){
|
||||
foreach($idList as $id) {
|
||||
$itemsToDelete[$id] = false;
|
||||
if(!$has[$id] && $id) {
|
||||
if(!isset($has[$id]) && $id) {
|
||||
$this->add($id);
|
||||
}
|
||||
}
|
||||
}
|
||||
// Delete any unmentionedItems
|
||||
if($itemsToDelete) {
|
||||
$removeList = array();
|
||||
foreach($itemsToDelete as $id => $actuallyDelete) {
|
||||
if($actuallyDelete) $removeList[] = $id;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user