After I install it with the latest Drupal8 RC1,
It does not work at all,

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

g089h515r806 created an issue. See original summary.

di3gopa’s picture

For reference, the error being displayed is

InvalidArgumentException: $string ("Pager") must be a string. in Drupal\Core\StringTranslation\TranslatableMarkup->__construct() (line 83 of /docroot/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php).

di3gopa’s picture

If you remove t() from pager, controls, slide counter on views_slideshow_views_slideshow_widget_info it starts to work again. I haven't check yet why this is happening.

ScottProck’s picture

I have found the same error when trying to build my first slideshow under Drupal 8.0.0-RC1 using the same beta1 and I get the same results with the dev version ... libraries-8.x-3.x-dev.

This should be easy to duplicate as I have been able to on every test so far.

Just create a new view, check the 'create block' select 'Slideshow' from the drop-down Display format using fields. Items per page at it's default (5) and use a pager unchecked.

After the view is created, click on the 'Settings' link next to the Slideshow format. The view will do nothing, but it will trigger an error found in the Recent Log messages.

Here's mine ...

Location http://example.com/admin/structure/views/ajax/display/test_ii/block_1/style_options?_wrapper_format=drupal_ajax&q=admin%2Fstructure%2Fviews%2Fajax%2Fdisplay%2Ftest_ii%2Fblock_1%2Fstyle_options

Referrer http://example.com/admin/structure/views/view/test_ii

Message InvalidArgumentException: $string ("Pager") must be a string. in Drupal\Core\StringTranslation\TranslatableMarkup->__construct() (line 83 of /var/www/punchblox/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php).

I'm still trying to track down which 'Pager' string that is throwing the error.

ScottProck’s picture

Priority: Normal » Major
Status: Active » Needs review
Issue tags: +InvalidArgumentException, +Pager must be a string

This is is what fixed it for me ...

File - views.slideshow.module
line number - 155
existing -
function views_slideshow_views_slideshow_widget_info() {

Change to -
function views_slideshow_widget_info() {

Basically that function implements hook_views_slideshow_widget_info as indicated in the comments above that section. The problem I saw is the current call of views_slideshow_views_slideshow_widget_info does not have an equivalent 'hook' declared in views_slideshow.api.inc (at least that's what made the most logical sense)

If I'm way off base let me know, but my Views Slideshow is working now ;-)

... Scott

ScottProck’s picture

FileSize
121.85 KB

Not sure if this was caused by my tweak, so I'll throw it out there in case it is.

I noticed now I don't have any widget attributes to set, I've been combing through the code, and I'm unable to discover why there's nothing showing up.

Attached is a screenshot to clarify ... Scott

vbouchet’s picture

I am currently working on finalizing a 8.x-4.0-beta1 version which will follow D8 best practices and move all widget hooks into plugins. I will check this version with the RC1 release.

Thanks,

ayalon’s picture

Did you made some progress here?

drm’s picture

I'm using RC2. No error but it is only displaying the first image and not cycling through. Views Slideshow Cycle is enabled.

vbouchet’s picture

Hi,

I pushed a 8.x-4.0-alpha1 release which is now following D8 patterns such as services and plugins for widget. I have not tested it extensively due to a limited availability so feedbacks and patches are welcomed. I will try to test it on the RC2 soon.

vbouchet’s picture

I tested it on RC2 and pushed an alpha2 which is working. What I tried:

- Enable Views Slideshow & Views Slideshow Cycle.
- Add jquery.cycle.all.js in libraries/jquery.cycle/ as explained.
- Create a new Views with a block display using the Slideshow format and listing Articles.
- I displayed content as Teaser in Content.
- I added the field Title in list of fields.
- In Slideshow settings, I kept the default settings and added a simple pager using the title field.
- I placed the block in the content region.
- I updated the Teaser view mode to display only the image field from the Article content type.
- I created some Article with images.

On the front page, the slideshow is sliding image, clicking a pager element switch to the appropriate slide.

drm’s picture

Okay, I've got 3.0-beta1 on my Drupal site. Can I upgrade that to your 4.0-alpha1? I've only got one slideshow view, so it isn't that bad if I have to rebuild it.

vbouchet’s picture

I should test it but it should work as the data format has not changed from 3.0-beta to 4.0-alpha. I should have removed the 3.0 branch earlier as it was only a first step to port Views Slideshow to D8 and I did not plan to maintain the 3.x branch as soon as the 4.x branch is released.
I will try to find time to test is during the weekend but if you test it before, please update this ticket so other people who already run a D8 website using the 3.x branch would know.

drm’s picture

Sorry I got pulled away for a few days. I replaced the code for the module, did a drush cache-rebuild, reloaded the admin/modules page, and the page with my Views slideshow is throwing an error:

Drupal\Component\Plugin\Exception\PluginNotFoundException: The "" plugin does not exist. in Drupal\Core\Plugin\DefaultPluginManager->doGetDefinition() (line 57 of core/lib/Drupal/Component/Plugin/Discovery/DiscoveryTrait.php).

http://d8ecs.deanmyerson.org/

The config export of the view yml file is attached.

PS - When editing the view, if I click on the settings link next to format: slideshow, I to not get a popup dialog. The rotating indicator comes up briefly and then goes away.

PPS - I created the exact same slideshow block from scratch and assigned it to a different page and am getting the same error.

vbouchet’s picture

Hi drm,

Thanks for pointing me this issue. I guess you tried on RC3. The alpha2 was working (or at least displaying the form and working with basic settings - 10d ago). I just tried it on RC3 and various issues appeared such as inappropriate placeholder format (!placeholder instead of @placeholder) and uninitialized form.

I just pushed an alpha3 release which should fix these. I have not tested your yml file yet and hope to have time to do it later this week. Please let me know if this alpha3 helped you to rebuild your Views.

drm’s picture

vbouchet,

I installed your new alpha3 and the error has not gone away. I am still in RC2, though I don't think that could be causing it.

vbouchet’s picture

Version: 8.x-3.0-beta1 » 8.x-4.x-dev

Hi drm,

Are you able to view the settings form (by clicking the "Settings" link just aside the Slideshow format)? I have been able to reproduce the issue and it goes away as soon as I view the settings form and click the Save button even if I don't change anything.

It seems the default values are not set properly while the settings form is not submitted. I will try to fix it soon.

vbouchet’s picture

I just pushed a new alpha release which should fix the issue. The slideshow now works even you don't edit/submit the Slideshow format settings form.

drm’s picture

vbouchet - Yes, that solved the issue. My old view still throws the error (even after saving the settings), but the new one I created recently works now. These is another formatting issue, but I'm not going to bring that up here. If I can't figure it out, I will create a new issue.

TheOrbix’s picture

I have the same problem reported by DRM on post #9:

No error but it is only displaying the first image and not cycling through. Views Slideshow Cycle is enabled.

I'm using Drupal 8.01 and I've tried both views_slideshow-8.x-4.0-alpha4-2.tar and views_slideshow-8.x-4.0-alpha4.tar with the same results.

This is what I did:
- Enabled Views Slideshow & Views Slideshow Cycle.
- Created a new content type called MySlides with two fields: Title and Image
- Created a new View with a block display using the Slideshow format and listing MySlides.
- I added the field Title in list of fields.
- I added the field Image in list of fields.
- In Slideshow settings, I kept the default settings.
- I placed the block in the content region.
- I created two MySlides with images.

The home page displays the first image, but the slideshow does not work.

In the Slideshow settings I've enabled the Top Widgets and these controls display regularly. But if try to click on the Previous / Next links, nothing happens...

The log files contain no errors.

One significant difference is that I did not apply this step (see post #11):
- Add jquery.cycle.all.js in libraries/jquery.cycle/ as explained.

Where should I find this file? It does not seem to be contained in the .tar file.

TheOrbix’s picture

OK, problem solved... to make the slideshow work was necessary to manually download and install under the virtual directory of drupal a number of JavaScript modules:

  jQuery.cycle.all.js
  jQuery.hoverIntent.js
  jQuery.pause.js
  json2.js

In my case I had to manually create a \libraries directory under the Drupal 8 root and then a directory for each JavaScript module.
This is the full path of each module:

  <localhost>/drupal/libraries/jquery.cycle.all/jQuery.cycle.all.js
  <localhost>/drupal/libraries/jquery.hoverIntent/jQuery.hoverIntent.js
  <localhost>/drupal/libraries/jquery.pause/jQuery.pause.js
  <localhost>/drupal/libraries/json2/json2.js

After manually copying these files, I rebuilt the Drupal caches, and voilà the slideshow was working...

vbouchet’s picture

Hi TheOrbix,

Sorry for the very very late feedback. It seems the documentation or install steps should be updated or made easier to understand. As you said/discovered, Views Slideshow requires JQuery Cycle to work properly. Other libraries are optional and only required for advanced settings.

The installation process between D7 and D8 has not changed. Views Slideshow has been designed to be generic so developers can create additional modules to extend Views Slideshow based on any other javascript library. By default, Views Slideshow provides the Views Slideshow Cycle sub-module which is based on JQuery Cycle. It is not packaged in the module so we don't have to update the module each time the third-party library is updated. In D7, it requires the Library API module to works properly (and the installation of libraries in the dedicated folder is described in the module documentation) but in D8, a new core API has been designed to handle it.

NickDickinsonWilde’s picture

Status: Needs review » Closed (won't fix)

The 8.x-3.x branch is not being maintained, instead use the 8.x-4.x branch and make sure to manually dl the required JavaScript files (at least jQuery cycle and optionally some other libraries)