#3530210: Support LMS reference revisions
3 open threads
3 open threads
Closes #3530210
Edited by Marcin Grabias
Merge request reports
Activity
248 248 ->setSetting('handler', 'default') 249 249 ->setRequired(TRUE); 250 250 251 $fields['gid'] = BaseFieldDefinition::create('entity_reference') 252 ->setLabel(\t('Training')) 253 ->setDescription(\t('The Training of the Course Status entity.')) 251 $fields['gid'] = BaseFieldDefinition::create('lms_revision_reference') changed this line in version 5 of the diff
36 36 '#description' => $this->t('This allows students to reenter finished courses that still need manual grading by a teacher and make changes to their answers. NOTE: If changed on a site with existing courses that are already in progress, caches need to be cleared.'), 37 37 '#config_target' => 'lms.settings:allow_to_enter_ungraded', 38 38 ]; 39 $form['use_revisions'] = [ 40 '#type' => 'checkbox', 41 '#title' => $this->t('Use revisions'), 42 '#description' => $this->t('When this is enabled and the current user starts a course, a lesson or an activity, the currently published revision is locked for the student and updates to those entities while the course is in progress do not affect the student experience in any way.'), changed this line in version 9 of the diff
3 declare(strict_types=1); 4 5 namespace Drupal\lms\Plugin\Field\FieldType; 6 7 use Drupal\Core\Entity\Plugin\DataType\EntityReference; 8 use Drupal\Core\Entity\RevisionableInterface; 9 use Drupal\Core\Field\Attribute\FieldType; 10 use Drupal\Core\Field\EntityReferenceFieldItemList; 11 use Drupal\Core\Field\FieldStorageDefinitionInterface; 12 use Drupal\Core\Field\Plugin\Field\FieldType\EntityReferenceItem; 13 use Drupal\Core\StringTranslation\TranslatableMarkup; 14 use Drupal\Core\TypedData\DataReferenceDefinition; 15 use Drupal\Core\TypedData\DataReferenceTargetDefinition; 16 17 /** 18 * Defines the 'entity_reference' entity field type. changed this line in version 14 of the diff
added 1 commit
- 7d66ec87 - Refacored logic; revisions UI improvements and additions.
- Resolved by Marcin Grabias
added 1 commit
- 90a9326f - Revision UI and data integrity checking work.
added 2 commits
@ob3ron, committed your update hooks, here's some feedback:
- Call to undefined method Drupal\Core\Entity\EntityDefinitionUpdateManager::installFieldDefinition() - I think we can just remove those calls
- Testing: a) checkout 1.0.8, composer sid, as admin enrolled to Course 1, did a few activities, checked out this branch and ran drush updb (with 1 resolved by removing), reentered the course but getting "The requested lesson is not a part of the course" checked the course and it has 2 lessons so update must be doing something wrong with references.
added 4 commits
-
0a5af7d2...b67133c2 - 3 commits from branch
project:1.0.x
- 3b68a403 - Merged 1.0.x.
-
0a5af7d2...b67133c2 - 3 commits from branch
Please register or sign in to reply