When using weight, I get a lot of these messages in the log:

Strict warning: Non-static method Drupal\weight\Plugin\Field\FieldWidget\WeightSelectorWidget::rangeOptions() should not be called statically, assuming $this from incompatible context in Drupal\weight\Plugin\views\field\WeightSelector->viewsForm() (line 66 of /modules/weight/src/Plugin/views/field/WeightSelector.php).

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Lukas von Blarer created an issue. See original summary.

ExTexan’s picture

Priority: Normal » Major

I'm getting (sort of) the same thing, though mine is worded differently...

Deprecated function: Non-static method Drupal\weight\Plugin\Field\FieldWidget\WeightSelectorWidget::rangeOptions() should not be called statically in Drupal\weight\Plugin\views\field\WeightSelector->viewsForm() (line 66 of modules/weight/src/Plugin/views/field/WeightSelector.php).
tusharbodke’s picture

Assigned: Unassigned » tusharbodke
tusharbodke’s picture

Assigned: tusharbodke » Unassigned
Status: Active » Needs review
FileSize
1.17 KB

Hi Lukas von Blarer, ExTexan

I have attached Patch to resolve above reported issue. Please have a try. Let me know if anything.
Patch is working fine for me.

Thanks

gaurav.bajpai’s picture

Status: Needs review » Reviewed & tested by the community

Hi Tushar,

your patch working fine, At code level everything looks fine to me.

Thanks

morsok’s picture

Works for me too, thank you !

  • davisben committed 0ef6703 on 8.x-3.x authored by tusharbodke
    Issue #2671844 by tusharbodke: Strict warning: Non-static method Drupal\...
davisben’s picture

Status: Reviewed & tested by the community » Fixed

Thanks for the patch. Committed to 8.x-3.x.

Status: Fixed » Closed (fixed)

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

drholera’s picture

FileSize
2.14 KB

I suggest a bit better solution, to use Drupal services instead.