Skip to content

Commit

Permalink
Revert changes related to user deletion and userId not being required…
Browse files Browse the repository at this point in the history
…. userId *is* required
  • Loading branch information
benjamindavid committed Jun 3, 2016
1 parent 8940074 commit 3b82d46
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 44 deletions.
16 changes: 1 addition & 15 deletions LikePlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,20 +33,6 @@ public function init()
}
}
});

craft()->on('users.onBeforeDeleteUser', function(Event $event) {

if (!craft()->config->get('retainLikesOnUserDeletion', 'like'))
{
$user = $event->params['user'];
$likes = craft()->like->getLikesByUserId($user->id);

foreach($likes as $like)
{
craft()->like->deleteLikeById($like->id);
}
}
});
}

/**
Expand All @@ -70,7 +56,7 @@ function getVersion()
*/
public function getSchemaVersion()
{
return '0.9.8';
return '1.0.0';
}

/**
Expand Down
5 changes: 0 additions & 5 deletions config.php

This file was deleted.

23 changes: 0 additions & 23 deletions migrations/m160501_000001_like_make_userId_column_not_required.php

This file was deleted.

2 changes: 1 addition & 1 deletion records/LikeRecord.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public function defineIndexes()
public function defineRelations()
{
return array(
'user' => array(static::BELONGS_TO, 'UserRecord', 'userId', 'required' => false),
'user' => array(static::BELONGS_TO, 'UserRecord', 'userId', 'required' => true),
'element' => array(static::BELONGS_TO, 'ElementRecord', 'elementId', 'required' => true)
);
}
Expand Down

0 comments on commit 3b82d46

Please sign in to comment.