Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
rjmackay committed Aug 27, 2017
2 parents 81b5855 + f7ca0b3 commit d24d166
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions application/classes/Ushahidi/Validator/Post/Create.php
Original file line number Diff line number Diff line change
Expand Up @@ -342,10 +342,12 @@ public function checkRequiredPostAttributes(Validation $validation, $attributes,
// Load the required attributes
$required_attributes = $this->attribute_repo->getRequired($stage->id);

// Check each attribute has been completed
foreach ($required_attributes as $attr)
{
if (!array_key_exists($attr->key, $attributes))
// Post has two special required attributes Title and Desription
// these are checked separately and skipped here.
// TODO: Refactor Title and Description to be handled as Post Values
if (!in_array($attr->type, ['title', 'description']) && !array_key_exists($attr->key, $attributes))
{
// If a required attribute isn't completed, throw an error
$validation->error('values', 'postAttributeRequired', [$attr->label, $stage->label]);
Expand Down

0 comments on commit d24d166

Please sign in to comment.