Issue:3464143-provide-option-to: Provided-option-to-infinite-loop
5 unresolved threads
Closes #3464143
Merge request reports
Activity
Filter activity
122 128 * {@inheritdoc} 123 129 */ 124 130 public function submitForm(array &$form, FormStateInterface $form_state) { 125 // Save the config values. changed this line in version 2 of the diff
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. changed this line in version 2 of the diff
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", [ changed this line in version 2 of the diff
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; changed this line in version 2 of the diff
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(); added 1 commit
Please register or sign in to reply