Commit 0184c695 authored by mathieso's avatar mathieso

Test, test, test, and test again.

parent c510cb2e
......@@ -9,6 +9,19 @@ X - initial valuies of new config flags and shit.
? Trimmed date format
# History
All records owned by nobody?
Submission feedback - put JSON of eval and other things in history record.
Remove JSON field from submission content type.
# Suggestion
Confirm cancel
# SUbmission delays - user confidence
......
No preview for this file type
......@@ -76,12 +76,20 @@ class SkillingHistoryListBuilder extends EntityListBuilder {
/**
* {@inheritdoc}
* @throws \Drupal\Core\Entity\EntityMalformedException
*/
public function buildRow(EntityInterface $entity) {
/** @var \Drupal\skilling_history\Entity\SkillingHistoryInterface $entity */
$row['id'] = $entity->toLink($entity->label());
$row['bundle_id'] = $entity->bundle();
$row['owner'] = $entity->getOwner()->toLink($entity->getOwner()->label());
$owner = $entity->getOwner();
if (is_null($owner)) {
$result = $this->t("(Nobody)");
}
else {
$result = $owner->toLink($entity->getOwner()->label());
}
$row['owner'] = $result;
$row['created'] = $this->dateFormatter->format($entity->getCreatedTime(), 'short');
$row['changed'] = $this->dateFormatter->format($entity->getChangedTime(), 'short');
$row['notes'] = $entity->getNotes();
......
......@@ -1249,7 +1249,8 @@ class AssessmentController extends ControllerBase {
$result = [
'status' => 'ARGH!',
];
return new JsonResponse($result); }
return new JsonResponse($result);
}
$title = $this->t(
"Feedback for '@exercise'",
['@exercise' => $exercise->getTitle()]
......
......@@ -57,7 +57,9 @@ class DateEventHappens extends FieldPluginBase {
// Get the class start date.
/** @var \Drupal\node\Entity\Node $class */
$class = $values->_entity;
$classStartDate = $class->field_when_starts->value;
$classStartDate = $class->get(SkillingConstants::FIELD_WHEN_STARTS)
->getValue()[0]['value'];
// $classStartDate = $class->field_when_starts->value;
$classStartDate = new DateTime($classStartDate);
// Get the day offset the event happens.
/** @var \Drupal\paragraphs\ParagraphInterface $calendarEvent */
......
......@@ -241,7 +241,7 @@ class Timeline {
});
$now = new DateTime();
// Date the class starts. May be in the middle of a week.
$classStartDate = new DateTime($this->currentClass->field_when_starts->value);
$classStartDate = new DateTime($this->currentClass->getStartDate());
// Day of the week the class starts, 0=Sunday.
$classStartDateDayOfWeek = (int) $classStartDate->format('w');
// Displayed calendar starts from the beginning of the week
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment