Move patch to a MR
6 open threads
Closes #3008369
Merge request reports
Activity
156 156 * Returns the limit of the query. 157 157 */ 158 158 public function getLimit() { 159 // Prevent of crash on live preview with large sets. 156 156 * Returns the limit of the query. 157 157 */ 158 158 public function getLimit() { 159 // Prevent of crash on live preview with large sets. 160 if (!empty($this->view->live_preview)) { 161 $live_preview_limit = \Drupal::ConfigFactory()->get('views.settings')->get('ui.show.live_preview_limit') ?: 50; 162 if (empty($this->limit) || $this->limit > $live_preview_limit) { 163 $options = [ 164 '%limit' => !empty($this->limit) ? $this->limit : '', 165 '%live_preview_limit' => $live_preview_limit, 166 ]; 167 $message = $this->t('Limit of results is not set. The live preview has a limit of %live_preview_limit items per page.', $options); 156 156 * Returns the limit of the query. 157 157 */ 158 158 public function getLimit() { 159 // Prevent of crash on live preview with large sets. 160 if (!empty($this->view->live_preview)) { 161 $live_preview_limit = \Drupal::ConfigFactory()->get('views.settings')->get('ui.show.live_preview_limit') ?: 50; 162 if (empty($this->limit) || $this->limit > $live_preview_limit) { 217 $record = [ 218 'name' => $this->randomString(12), 219 'age' => 50, 220 'job' => $this->randomString(32), 221 'created' => gmmktime(0, 0, 0, 1, 1, 2000), 222 'status' => 1, 223 ]; 224 $query->values($record); 225 } 226 $query->execute(); 227 228 // Test display all items. 229 $this->drupalGet('admin/structure/views/nojs/display/test_preview/default/pager'); 230 $this->submitForm($edit = ['pager[type]' => 'none'], 'Apply'); 231 $this->drupalGet('admin/structure/views/view/test_preview/edit'); 232 $this->submitForm($edit = [], t('Save')); 201 203 $this->assertCount(0, $this->xpath('//div[@id="views-live-preview"]//b[text()=:text]', [':text' => 'Test preview title'])); 202 204 } 203 205 206 /** 207 * Tests the live preview limit. 208 */ 209 public function testPreviewLimit() { 210 $live_preview_limit = \Drupal::ConfigFactory()->get('views.settings')->get('ui.show.live_preview_limit') ?: 50;
Please register or sign in to reply