Steps to reproduce this error :-

1) Create a view page display, set path for the page.
2) Include fields, Title field and views row counter field, Save view.
3) Check the url of the page display, it will produce following error.

Warning: Missing argument 1 for Drupal\views\Plugin\views\pager\PagerPluginBase::set_offset(), called in C:\wamp\www\drupal-8.x-dev\core\modules\views\lib\Drupal\views\Plugin\views\field\Counter.php on line 55 and defined in Drupal\views\Plugin\views\pager\PagerPluginBase->set_offset() (line 84 of core\modules\views\lib\Drupal\views\Plugin\views\pager\PagerPluginBase.php).

Please check the attached screen shot for the errors which i can see on my screen.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dawehner’s picture

Status: Active » Needs review
Issue tags: +Needs tests
FileSize
800 bytes

Thanks for reporting!

Posting the fix, but i think this should be able tested so the fail never happens again

tajinder.minhas’s picture

Your welcome dawehner,

I want to be more active in community, so finding the ways for me. I found checking drupal8 interesting so was working on it. Maybe you can suggest better way to get involved in the community.

dawehner’s picture

Welcome in the community!

So one way how you could get involved is to write tests for that issue.

The idea behind is to write code, which checks the expected output.
The file in which the tests for that field exists is http://api.drupal.org/api/drupal/core!modules!views!lib!Drupal!views!Tes...
so feel free to improve them. Feel free to ask if you need more information.

dawehner’s picture

Issue tags: -Needs tests +PHPUnit, +VDC
FileSize
12.71 KB
7.95 KB

Let's replace the existing tests with phpunit and extend it with pager related tests.

ParisLiakos’s picture

+++ b/core/modules/views/tests/Drupal/views/Tests/Plugin/field/CounterTest.phpundefined
@@ -0,0 +1,139 @@
+  public function testGetValue() {

i am not sure whether we could break this test up so we dont duplicate code?

especially this for loop is 3 times the same code

dawehner’s picture

FileSize
14.5 KB

Really good idea!!

So what about something like that?

Status: Needs review » Needs work
Issue tags: -PHPUnit, -VDC

The last submitted patch, vdc-1830828-6.patch, failed testing.

ParisLiakos’s picture

Status: Needs work » Needs review
Issue tags: +PHPUnit, +VDC

#6: vdc-1830828-6.patch queued for re-testing.

ParisLiakos’s picture

Status: Needs review » Reviewed & tested by the community

definitely better now, i canm understand whats going on

+++ b/core/modules/views/lib/Drupal/views/ViewExecutable.phpundefined
@@ -424,7 +424,10 @@ public function __construct(ViewStorageInterface $storage) {
+    // @todo Make views.module.css a library.
+    if (function_exists('drupal_get_path')) {
+      $this->element['#attached']['css'][] = drupal_get_path('module', 'views') . '/css/views.module.css';
+    }

this will be fixed @ #2005616: Views should use ['#attached']['library'] rather than ['#attached']['css']

whichever goes in first the other will be rerolled

ParisLiakos’s picture

Status: Reviewed & tested by the community » Needs work

issue above committed

Pancho’s picture

Status: Needs work » Needs review
FileSize
13.74 KB
ParisLiakos’s picture

Status: Needs review » Reviewed & tested by the community

thank you

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed bf1b3d2 and pushed to 8.x. Thanks!

Automatically closed -- issue fixed for 2 weeks with no activity.

Anonymous’s picture

Issue summary: View changes

I have mentioned the steps how to reproduce the issue which i have raised.