Skip to content
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

Rw 1058 round 3 #968

Open
wants to merge 12 commits into
base: develop
Choose a base branch
from
12 changes: 8 additions & 4 deletions html/modules/custom/reliefweb_entities/src/Entity/Report.php
Original file line number Diff line number Diff line change
Expand Up @@ -242,8 +242,15 @@ public function preSave(EntityStorageInterface $storage) {
}
}

// Update the entity status based on the user posting rights.
$this->updateModerationStatusFromPostingRights();

// Change the status to `embargoed` if there is an embargo date.
if (!empty($this->field_embargo_date->value) && $this->getModerationStatus() !== 'draft') {
if (!empty($this->field_embargo_date->value) && !in_array($this->getModerationStatus(), [
'draft',
'pending',
'refused',
])) {
$this->setModerationStatus('embargoed');

$message = strtr('Embargoed (to be automatically published on @date).', [
Expand All @@ -258,9 +265,6 @@ public function preSave(EntityStorageInterface $storage) {
// Prepare notifications.
$this->preparePublicationNotification();

// Update the entity status based on the user posting rights.
$this->updateModerationStatusFromPostingRights();

// Update the entity status based on the source(s) moderation status.
$this->updateModerationStatusFromSourceStatus();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,6 @@ protected function alterFieldsForContributors(array &$form, FormStateInterface $
// Hide fields.
$form['field_bury']['#access'] = FALSE;
$form['field_feature']['#access'] = FALSE;
$form['field_notify']['#access'] = FALSE;
attiks marked this conversation as resolved.
Show resolved Hide resolved

$form['field_headline']['#access'] = FALSE;
$form['field_headline_title']['#access'] = FALSE;
Expand Down
Loading