Skip to content
Snippets Groups Projects

Issue:3464143-provide-option-to: Provided-option-to-infinite-loop

Open Dhruv Mittal requested to merge issue/prevnext-3464143:3464143-provide-option-to into 3.0.x
5 unresolved threads

Closes #3464143

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
122 128 * {@inheritdoc}
123 129 */
124 130 public function submitForm(array &$form, FormStateInterface $form_state) {
125 // Save the config values.
  • 133 138 $this->config('prevnext.settings')
    134 139 ->set('prevnext_enabled_entity_types', $entity_types)
    135 140 ->set('prevnext_enabled_entity_bundles', $entity_bundles)
    141 // Save checkbox value.
  • 108 109
    109 110 foreach ($items as $item) {
    110 111 if ($previous_next[$item['key']]) {
    111 $path = '';
    112 try {
    113 // Try to build canonical URL for the entity type.
    114 $path = Url::fromRoute("entity.{$entity->getEntityTypeId()}.canonical", [$entity->getEntityTypeId() => $previous_next[$item['key']]])->toString();
    115 }
    116 catch (\Exception $e) {
    117 }
    112 // Generate URL using the entity ID.
    113 $path = Url::fromRoute("entity.{$entity->getEntityTypeId()}.canonical", [
  • 179 175 $query->addMetaData($lang, $langcode);
    180 176 }
    181 177
    178 $config = $this->configFactory->get('prevnext.settings');
    179 $infinite_loop = $config->get('prevnext_infinite_loop') ?? 0;
  • 190 189 $query->condition($id, $entity->id(), '>');
    191 190 $query->sort($id);
    192 191 break;
    192 }
    193
    194 $result = $query->execute();
    195 if (empty($result) && $infinite_loop) {
    196 $query = $this->entityTypeManager->getStorage($entity->getEntityTypeId())->getQuery();
  • Dhruv Mittal added 1 commit

    added 1 commit

    Compare with previous version

  • Please register or sign in to reply
    Loading