Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
DraggableViews handlers changed.
Now all handlers are derived from a default handler which implements default methods. The current version of flag_weights produces a fatal error because of a missing get() method.
With the attached patch you stay compatible with the latest BETA and dev-snapshot of DraggableViews.
Index: draggableviews_handler_flag_weights.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/flag_weights/Attic/draggableviews_handler_flag_weights.inc,v
retrieving revision 1.1.2.4
diff -u -p -r1.1.2.4 draggableviews_handler_flag_weights.inc
--- draggableviews_handler_flag_weights.inc 26 Aug 2009 10:36:07 -0000 1.1.2.4
+++ draggableviews_handler_flag_weights.inc 18 Sep 2009 12:07:24 -0000
@@ -9,9 +9,10 @@
/*
* Implementation using the Flag Weight module.
*/
-class draggableviews_handler_flag_weights {
-
+class draggableviews_handler_flag_weights extends draggableviews_handler {
function init($field_name, &$view) {
+ parent::init($field_name, &$view);
+
// Check that the handler is being used on the right type of field.
if ($view->field[$field_name]->table != 'flag_content') {
drupal_set_message("This handler cannot be applied to this field - use Weight!");
@@ -23,9 +24,6 @@ class draggableviews_handler_flag_weight
$relationship = $view->relationship['flag_content_rel'];
$this->flag_id = $relationship->definition['extra'][0]['value'];
$this->flag = flag_get_flag($relationship->options['flag']);
-
- $this->view = $view;
- $this->pager = $view->pager;
}
function save($nid, $value) {
@@ -35,27 +33,4 @@ class draggableviews_handler_flag_weight
flag_weights_set_weight($this->flag_id, 'node', $nid, $uid, $value);
}
-
- function get_form_element($value, $attributes = array()) {
- $options = array();
- for ($i = $this->range_start; $i <= $this->range_end; $i++) $options[$i] = $i;
-
- return array(
- '#type' => 'select',
- '#name' => $attributes['field_name'],
- '#value' => $value,
- '#options' => $options,
- '#attributes' => array('class' => $attributes['class']),
- );
- break;
- }
-
- function set_range($start, $end) {
- $this->range_start = $start;
- $this->range_end = $end;
- }
-
- function get_minimum_value() {
- return -1;
- }
}
Comment | File | Size | Author |
---|---|---|---|
flag_weights_draggableviews_update.patch | 2.02 KB | sevi |
Comments
Comment #1
jcmarco CreditAttribution: jcmarco commentedTested and working fine.
The actual flag_weights is broken due to changes in draggable views
Thank you very much for this patch.
Comment #2
q0rban CreditAttribution: q0rban commentedSubscribing, and pasting in the error you get without this patch, so it's searchable:
Fatal error: Call to undefined method draggableviews_handler_flag_weights::get() in sites/all/modules/draggableviews/draggableviews.inc on line 173
Comment #3
q0rban CreditAttribution: q0rban commentedTested and works.
Comment #4
lyricnz CreditAttribution: lyricnz commentedConfirmed error, applied, retest, fixed. Thanks!