Closed (fixed)
Project:
Views (for Drupal 7)
Version:
7.x-3.x-dev
Component:
Miscellaneous
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
14 Mar 2011 at 13:14 UTC
Updated:
11 Jan 2013 at 09:49 UTC
Jump to comment: Most recent file
Comments
Comment #1
johnvThis eliminates the message, and my views look OK again:
Comment #2
johnvComment #3
bojanz commentedNot necessarily correct.
We want the "format" column value, it is not present for some reason, and your code just returns the default column (which might be format, but it might be something else..).
What we need to figure out is which handler is calling the function with the wrong value.
Can you provide an exported view? Cause I'm having trouble reproducing.
Comment #4
johnvSee attached file with a simple Term view. 1 default display + 2 page displays, each for another Vocabulary.
Comment #5
johnvBTW: might be related to: #1092040: dev-update: field 'Taxonomy: Term description' empty with log message "Missing text format".
Comment #6
bojanz commentedTest this patch. It might not fix the notice, but it's definitely part of the final fix.
Comment #7
bojanz commentedComment #8
johnvI added your patch, removed mine. The results are:
- the error for taxonomy_term_data_format has gone
- the error for format still exists
I have stripped and appended one of my node views, where the error still exists.
Comment #9
dawehnerWhat about this patch?
Comment #10
Jerome F commentedI tried the patch in #9 and I still get :
Notice : Undefined index: format in views_handler_field->get_value() (line 738 in (...)/public_html/sites/all/modules/views/handlers/views_handler_field.inc).Comment #11
johnvSame result as Jerome for patch #9: still errors in 'format' . The other error with 'taxonomy_term_data_format' is now OK.
Comment #12
johnvPS. I set the message to critical, because the message are in the user's face. Was that the correct decision?
Comment #13
jon nunan commented#3 For node views I believe I tracked down which call to 'get_value' is causing it. It's part of node edit links.
/views/module/node/views_handler_field_node_link_edit.inc
line 18:
$node->format = $this->get_value($values, 'format');If I change that 'format' to 'format2' the error now complains about 'format2' to being the missing index.
Sorry, haven't got my head around the whole views thing yet, so no patch, but commenting out the line above seems to work...
Comment #14
bojanz commentedThanks, meatsack. This is the crucial info we need.
Looking at the get_values patch, the format call was added in it:
Same for the delete link.
dereine, do you know why? Yours was the first version of the patch.
Only the node links (ones for revisions as well) got the format added.
So, we either need to kill the added format lines, or actually make sure that the format column is added to the query.
Then merge those changes with mine in #6, and we're good to go.
Comment #15
jastraat commentedsubscribing
Comment #16
dawehnerYou basically can't trust me....
The only reason i could think of was a stupid c&p error.
Go ahead and provide a patch.
Comment #17
bojanz commentedThat's why we have -dev.
Though it would be nice if we had a usable release that's not -dev :)
Comment #18
calbert commented@ #17 how do I run this patch??
Comment #19
bojanz commentedcd views/
patch -p1 < 1091980.patch
Comment #20
calbert commentedI am still getting the following error
•Notice: Undefined index: format in views_handler_field->get_value() (line 738 of /var/www/vhosts/metrosource/drupal-7.0/modules/views/handlers/views_handler_field.inc).
•Notice: Undefined index: format in views_handler_field->get_value() (line 738 of /var/www/vhosts/metrosource/drupal-7.0/modules/views/handlers/views_handler_field.inc).
•Notice: Undefined index: format in views_handler_field->get_value() (line 738 of /var/www/vhosts/metrosource/drupal-7.0/modules/views/handlers/views_handler_field.inc).
•Notice: Undefined index: format in views_handler_field->get_value() (line 738 of /var/www/vhosts/metrosource/drupal-7.0/modules/views/handlers/views_handler_field.inc).
•Notice: Undefined index: format in views_handler_field->get_value() (line 738 of /var/www/vhosts/metrosource/drupal-7.0/modules/views/handlers/views_handler_field.inc).
•Notice: Undefined index: format in views_handler_field->get_value() (line 738 of /var/www/vhosts/metrosource/drupal-7.0/modules/views/handlers/views_handler_field.inc).
•Notice: Undefined index: format in views_handler_field->get_value() (line 738 of /var/www/vhosts/metrosource/drupal-7.0/modules/views/handlers/views_handler_field.inc).
Here is the code, please any help .. I am in over my head ,,
function get_value($values, $field = NULL) {
738 $alias = isset($field) ? $this->aliases[$field] : $this->field_alias;
739 if (isset($values->{$alias})) {
740 return $values->{$alias};
Comment #21
johnvpatch 17 removes all messages.
I found a similar 'format' statement in views_handler_field_node_link_translate.inc. Should that file be changed?
Comment #22
calbert commented@ #13
My code is not the same here is the /views/module/node/views_handler_field_node_link_edit.inc
1 <?php
2 /**
3 * Field handler to present a link node edit.
4 */
5 class views_handler_field_node_link_edit extends views_handler_field_node_link {
6 function construct() {
7 parent::construct();
8 $this->additional_fields['uid'] = 'uid';
9 $this->additional_fields['type'] = 'type';
10 }
11
12 function render_link($data, $values) {
13 // ensure user has access to edit this node.
14 $node = new stdClass();
15 $node->nid = $this->get_value($values, 'nid');
16 $node->uid = $this->get_value($values, 'uid');
17 $node->type = $this->get_value($values, 'type');
18 $node->status = 1; // unpublished nodes ignore access control
19 if (!node_access('update', $node)) {
20 return;
21 }
22
23 $this->options['alter']['make_link'] = TRUE;
24 $this->options['alter']['path'] = "node/$node->nid/edit";
25 $this->options['alter']['query'] = drupal_get_destination();
26
27 $text = !empty($this->options['text']) ? $this->options['text'] : t('edit');
28 return $text;
29 }
30 }
Comment #23
calbert commentedPatch #17 did nothing for me, same error..
Comment #24
bojanz commented@21
No, that one's fine.
Waiting for other people to test. Right now it seems that we have a 50% success rate :)
Comment #25
bojanz commentedChanging title
Comment #26
jastraat commentedThat fixed the error for me -
Comment #27
johnv@22, I applied the patch by hand, so I am not sure about if the file is exactly the same. I just removed/changed the lines.
Comment #28
calbert commentedany update on this problem for me .. please?
I applied the patch and didn't fix my problem..
•Notice: Undefined index: format in views_handler_field->get_value() (line 738 of /var/www/vhosts/metrosource/drupal-7.0/modules/views/handlers/views_handler_field.inc).
•Notice: Undefined index: format in views_handler_field->get_value() (line 738 of /var/www/vhosts/metrosource/drupal-7.0/modules/views/handlers/views_handler_field.inc).
•Notice: Undefined index: format in views_handler_field->get_value() (line 738 of /var/www/vhosts/metrosource/drupal-7.0/modules/views/handlers/views_handler_field.inc).
Comment #29
johnvCalbert, which version of -dev have you installed? I hope the 'latest'?
Comment #30
calbert commentedviews-7.x-3.x-dev
Comment #31
jon nunan commented@ #30
a new version of 7.x-3.x-dev comes out every couple of days, as its just a development snapshot of that branch it doesn't get a unique version number each time. If you downloaded it from drupal.org it should have a line from the packaging script in the views.info file, something like:
If you can find that line and tell us the date, we'll know what snapshot you're on.
Comment #32
bojanz commentedOr someone can upload a patched archive for him to try...
Comment #33
klaus66 commentedI tested the patch and it fixed the problem with the notice.
Comment #34
bojanz commented3 confirmations. RTBC
Comment #35
calbert commented@31
; Information added by drupal.org packaging script on 2011-03-14
version = "7.x-3.x-dev"
core = "7.x"
project = "views"
datestamp = "1300062218"
Comment #36
bojanz commentedLet's get the current patch in. It solves the problem for most people, and is definitely needed.
If calbert's problem persists, we'll debug it separately (by providing a views export, which he didn't do so far)
Comment #37
merlinofchaos commentedCommitted and pushed upstream.
Comment #38
calbert commented@#36 how do I provide a view export?
Comment #39
bojanz commentedTest first with the latest git version of views (or wait for dev until tomorrow). See if the problem is still there for you.
You have an export link in the views listing page, for each row (view).
Comment #40
bojanz commentedClosing again until we have more data.
Comment #41
calbert commentedI removed the old views downloaded the new one .. and now I get this error
* Notice: Undefined variable: field in ViewsUiBaseViewsWizard->default_display_options() (line 521 of /var/www/vhosts/metrosource/drupal-7.0/modules/views/plugins/views_wizard/views_ui_base_views_wizard.class.php).
* Notice: Undefined variable: field in ViewsUiBaseViewsWizard->default_display_options() (line 522 of /var/www/vhosts/metrosource/drupal-7.0/modules/views/plugins/views_wizard/views_ui_base_views_wizard.class.php).
* Notice: Undefined variable: field in ViewsUiBaseViewsWizard->default_display_options() (line 519 of /var/www/vhosts/metrosource/drupal-7.0/modules/views/plugins/views_wizard/views_ui_base_views_wizard.class.php).
* Notice: Undefined index: table in views_plugin_display->get_plugin() (line 708 of /var/www/vhosts/metrosource/drupal-7.0/modules/views/plugins/views_plugin_display.inc).
* Notice: Undefined index: table in views_plugin_display->get_plugin() (line 708 of /var/www/vhosts/metrosource/drupal-7.0/modules/views/plugins/views_plugin_display.inc).
* Notice: Undefined index: table in view->init_query() (line 571 of /var/www/vhosts/metrosource/drupal-7.0/modules/views/includes/view.inc).
Comment #42
johnv@calbert, congratulations, you're now one of merlin's launching customers! You have two actions:
- download also latest CTools
- read this: http://www.angrydonuts.com/views-for-drupal-7-enters-a-new-era
Good luck in the next fase of your quest for the working patch ;-)
Comment #43
bojanz commentedAccidental doublepost
Comment #44
bojanz commentedLatest ctools means today's git (tomorrow's dev). Alpha4 has a bug causing module provided default views (such as the ones from drupal commerce) to not show up.
I still haven't gotten a views export from calbert which would help me help him.
Also, "needs review" means there's a patch. There's no patch here.
Closing this issue since you don't mention seeing the format error. New UI notices can be handled in a separate issue.
Comment #45
johnvAs a wise man once (yesterday) said:
Comment #46
calbert commented* Notice: Undefined property: stdClass::$display_plugin in view->init_display() (line 239 of /var/www/vhosts/metrosource/drupal-7.0/modules/views/includes/view.inc).
* Notice: Undefined index: table in view->init_query() (line 571 of /var/www/vhosts/metrosource/drupal-7.0/modules/views/includes/view.inc).
The new version of this is giving me the following errors.
Comment #47
bojanz commentedWhich has nothing to do with the issue you posted in.
Comment #49
johnvBetter title when checking for similar errors.
These issues are similar/identical:
#1116346: Notice: Undefined index: format in views_handler_field->get_value() (line 314 of views_handler_field.inc)
#1091980: Notice: Undefined index: format in views_handler_field->get_value() (line 738 of views_handler_field.inc).