Just posting an issue regarding going Beta with 8.x-1. I think we are done with new features. Any comments about this post here while we move forward.

Comments

New Zeal created an issue. See original summary.

joekers’s picture

I agree, I think it would be good to fix bugs #2846625: Views reference field does not allow more than 1 argument for view and #2838413: The use of the t() function in ViewsReferenceFieldFormatter.php causes double escaping of the View Title beforehand so we can start a clean slate.

I also think we should do some code cleanup so we are following the coding standards, but that could be done during beta phase.

NewZeal’s picture

I'm happy to do the patch for the multiple arguments and hide that field behind a fieldset. I can also run the module through codesniffer.

NewZeal’s picture

I've pushed changes to the dev branch including:

Fix argument handling: https://www.drupal.org/node/2847192
Add multiple arguments: https://www.drupal.org/node/2846625
Fix placeholder error: https://www.drupal.org/node/2838413
Remove redundant code

I wasn't able to find a quick way to make an advanced tab. Fieldsets do not appear to be easy to hide using #states, so have simply moved the argument field to the end. I haven't tested the supplied patches so it is important for people to test that it works first before we push beta.

joekers’s picture

Whilst trying to test the latest commits, the display ID select list has stopped working - any ideas?

joekers’s picture

I think we should have tested the patches individually before committing them all to dev and then testing.

joekers’s picture

It looks like the old code in getViewDisplayIds() has been added back which prevents the display ID select list from working properly.

I can't see a commit where it was changed though so I'm confused...

In my last commit to master the code was:

  protected function getViewDisplayIds($entity_id) {
    $views =  \Drupal\views\Views::getAllViews();
    $options = array();
    foreach ($views as $view) {
      if ($view->get('id') == $entity_id) {
        foreach ($view->get('display') as $display) {
          $options[$display['id']] = $display['display_title'];
        }
      }
    }
    return $options;
  }

And now the code is:

  protected function getViewDisplayIds($entity_id) {
    $views =  \Drupal\views\Views::getAllViews();
    $options = array();
    $view_plugins = $this->getFieldSetting('plugin_types');
    foreach ($views as $view) {
      if ($view->get('id') == $entity_id) {
        foreach ($view->get('display') as $display) {
          if (in_array($display['display_plugin'], $view_plugins)) {
            $options[$display['id']] = $display['display_title'];
          }
        }
      }
    }
    return $options;
  }
NewZeal’s picture

OK so the new code is meant to limit the View displays available based on user settings. Maybe the problem is that no displays have been selected. You'll find checkboxes in the field settings for View display ids to include.

joekers’s picture

Ah ok, sorry I didn't realise you'd pushed that. Now that I've selected the displays in the fields settings I can see them available in the field :)

NewZeal’s picture

I'm still hoping to go beta soon. Some good bugs have been called out and will be included. Joekers, how are we going with the arguments: https://www.drupal.org/node/2846625 ?

joekers’s picture

I haven't heard back from the guy who reported the issue - I think it still needs fixing for multiple arguments. Not sure how you feel about releasing the beta without this functionality?

I can spend some time on trying to fix it as it doesn't look like EugeneChechel has had time.

joekers’s picture

@New Zeal would be great to know your thoughts on whether these should be added to the module, and whether you think they'd be good to get in during alpha?
#2846134: "Advanced Settings" Checkbox/Fieldset
#2858980: Add checkbox to show/hide pager - this now applies to 2.x branch
#2848762: Add Number/Offset Field - this now applies to 2.x branch
#2860736: Add option to limit results - this now applies to 2.x branch

I don't think they'd take long to complete, if you're happy for them to be added under an "Advanced" section then I'll get them committed asap.

NewZeal’s picture

As I said in another thread, I think you are doing a great job with this module. The problem with adding new fields at this stage is that it will break other people's sites during update. It would be better to start a 2.x branch with the new fields and keep this branch moving forward. Also, for the advanced settings, just create a single advanced field in the db table and then you can serialize any option you wish into it.

NewZeal’s picture

I think we should move to beta. I might have some time this week to do it. Any thoughts?

joekers’s picture

Yeah I'll go ahead with making a single serialised field for all our advanced settings.

Sure I'm fine with you moving to beta - the only thing I think we could wait for is progress on #2857697: Limit the initial Display IDs to those pre-selected in the field settings page. - where I think some regression has crept in, but we could always fix that later.

NewZeal’s picture

Status: Active » Fixed

Beta now released

Status: Fixed » Closed (fixed)

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