Version 4.6.0
This commit is contained in:
1 parent
f79dcf067a
commit
517a5e1f70
2036 files changed
+110041
-26162
No files matched your search
@@ -321,7 +321,7 @@ class _promote extends \IPS\Dispatcher\Controller
|
||||
throw new \InvalidArgumentException;
|
||||
}
|
||||
|
||||
$object = $class::load( $id );
|
||||
$object = $class::load( (int) $id );
|
||||
}
|
||||
catch ( \Exception $ex )
|
||||
{
|
||||
@@ -563,9 +563,11 @@ class _promote extends \IPS\Dispatcher\Controller
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$isNew = FALSE;
|
||||
if ( ! $promote )
|
||||
{
|
||||
$isNew = TRUE;
|
||||
$promote = new \IPS\core\Promote;
|
||||
$promote->class = $class;
|
||||
$promote->class_id = $id;
|
||||
@@ -584,8 +586,23 @@ class _promote extends \IPS\Dispatcher\Controller
|
||||
$promote->failed = 0; # Reset the failed flag if we're re-promoting
|
||||
$promote->sent = 0;
|
||||
$promote->form_data = $processedForms;
|
||||
|
||||
if ( is_subclass_of( $class, 'IPS\Content' ) )
|
||||
{
|
||||
$promote->author_id = $object->author()->member_id;
|
||||
}
|
||||
|
||||
$promote->save();
|
||||
|
||||
if ( $isNew )
|
||||
{
|
||||
/* Points */
|
||||
$promote->author()->achievementAction( 'core', 'ContentPromotion', [
|
||||
'content' => $promote->object(),
|
||||
'promotype' => 'promote'
|
||||
] );
|
||||
}
|
||||
|
||||
if ( isset( \IPS\Request::i()->promote_id ) )
|
||||
{
|
||||
/* Redirect back to the list */
|
||||
|
||||
Reference in new issue
Block a user