- Issue created by @erwangel
As said in the title if you uninstall the module the view containing a block managed by Contextual Range Filter disappears. I lost dozens of hours of work with a view where I had several pages and blocks. One of the block was using Contextual Range Filter but as it was not giving the expected results and also I suspected it to interfere with the results of the other blocks (I have to do some more verifications to confirm this last one), I disabled this block, and finally uninstalled it. The entire view was deleted with all pages and blocks it contained.
1 === Views preparation ===
2 === Contextual Range Filter ===
composer require 'drupal/contextual_range_filter:^2.0'
drush en contextual_range_filter
3 === Final settings ===
if (isset($entity['node'])) {</li>
$value_min = substr($entity['node']->title->value, 0,2);</li>
$value_max = substr($entity['node']->title->value, 0,4);</li>
return "$value_min--$value_max"; </li>
}</li>
4 === Disaster ===
Let's say that we are not satisfied by the results
You think you're fine with that and later you decide to uninstall the module
drush pm:uninstall contextual_range_filter
5 === Report of damages ===
Configuration: Drupal 10.3 - Contextual Range Filter 8x-2.0 - PHP
=== WORST THAN THAT ===
As a temporary workaround, I thought that setting back 1) the contextual filter to default value: Content ID from URL and 2) disabling "String: title in view yous_view_name" in admin/config/content/contextual-range-filter would be sufficient to unlink the Contextual Range Filter from my View. Well no. After undoing these settings and uninstalling the module, my view was again deleted. It's like my View has been contaminated forever.
Maybe if we completely remove the block, it will allow to uninstall without destroying the View but I have no more tie to spend on testing and debugging. As it stands, this module cannot be used given the damage it can cause without any warning.
Active
2.0
Code