Skip to content
Snippets Groups Projects

#3530210: Support LMS reference revisions

Closes #3530210

Edited by Marcin Grabias

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
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')
  • 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.'),
  • 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.
  • Marcin Grabias added 1 commit

    added 1 commit

    Compare with previous version

  • Marcin Grabias added 1 commit

    added 1 commit

    Compare with previous version

  • Marcin Grabias added 1 commit

    added 1 commit

    Compare with previous version

  • Marcin Grabias added 1 commit

    added 1 commit

    • 7d66ec87 - Refacored logic; revisions UI improvements and additions.

    Compare with previous version

  • Marcin Grabias added 1 commit

    added 1 commit

    Compare with previous version

  • Marcin Grabias added 1 commit

    added 1 commit

    Compare with previous version

  • Marcin Grabias added 1 commit

    added 1 commit

    Compare with previous version

  • Oberon Ray
  • Marcin Grabias added 1 commit

    added 1 commit

    • 90a9326f - Revision UI and data integrity checking work.

    Compare with previous version

  • Marcin Grabias added 2 commits

    added 2 commits

    Compare with previous version

  • Marcin Grabias added 1 commit

    added 1 commit

    Compare with previous version

  • Marcin Grabias added 1 commit

    added 1 commit

    Compare with previous version

  • Marcin Grabias marked this merge request as ready

    marked this merge request as ready

  • Marcin Grabias changed the description

    changed the description

  • @ob3ron, committed your update hooks, here's some feedback:

    1. Call to undefined method Drupal\Core\Entity\EntityDefinitionUpdateManager::installFieldDefinition() - I think we can just remove those calls
    2. 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.
  • Marcin Grabias added 4 commits

    added 4 commits

    Compare with previous version

  • Marcin Grabias added 1 commit

    added 1 commit

    • ceba0687 - Updated update hooks; Updated comment.

    Compare with previous version

  • Marcin Grabias added 1 commit

    added 1 commit

    Compare with previous version

  • Marcin Grabias added 2 commits

    added 2 commits

    • b9d13fbe - 1 commit from branch project:1.0.x
    • 072d040b - Merge branch '1.0.x' into 3530210-reference-revisions

    Compare with previous version

  • Marcin Grabias changed the description

    changed the description

  • Marcin Grabias changed target branch from 1.0.x to 1.1.x

    changed target branch from 1.0.x to 1.1.x

  • Oberon Ray added 1 commit

    added 1 commit

    • beeea755 - Revised hook_update and hook_post_update

    Compare with previous version

  • Oberon Ray added 1 commit

    added 1 commit

    Compare with previous version

  • Marcin Grabias added 4 commits

    added 4 commits

    Compare with previous version

  • Please register or sign in to reply
    Loading