I have a view with displaying nodes using the table formatter. I added the weight selector field and the table has draggable rows. But the actual select element is missing. instead this is being displayed:

<!--form-item-field_weight--0-->

The functionality is broken since the values are not stored after sorting.

CommentFileSizeAuthor
#4 weight-show-selector-2671840-4.patch985 bytesjlicht

Comments

Lukas von Blarer created an issue. See original summary.

fictionindustries’s picture

Same problem here. Without the weightselector everything works just fine. Once I add the weight selector to the table I get the same output and this error as well:

Deprecated function: 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/contrib/weight/src/Plugin/views/field/WeightSelector.php).

luksak’s picture

Were you able to solve this in the meantime?

jlicht’s picture

Status: Active » Needs review
StatusFileSize
new985 bytes

The problem is that the markup for the selector row was being escaped. Here's a patch that uses ViewsRenderPipelineMarkup to fix this.

luksak’s picture

Status: Needs review » Reviewed & tested by the community

This patch fixes the issue of the missing selects. RTBC

Something seems to be broken with the tabledrag. The handles are hidden. But lets create a follow up for this.

luksak’s picture

morsok’s picture

Works for me too, thank you !

davisben’s picture

Status: Reviewed & tested by the community » Fixed

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

  • davisben committed b7d2e7c on 8.x-3.x authored by jlicht
    Issue #2671840 by jlicht: Weight selector missing
    

Status: Fixed » Closed (fixed)

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