Active
Project:
LeagueSite
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
10 Dec 2010 at 19:24 UTC
Updated:
5 Apr 2011 at 12:52 UTC
A query is giving me the error message "Fatal error: Unsupported operand types in /etc/drupal/6/sites/all/modules/views/plugins/views_plugin_query_default.inc on line 696" when I try to "preview" the results.
The 696 line corresponds to:
// Create a field info array.
$field_info = array(
'field' => $field,
'table' => $table,
'alias' => $alias,
) + $params;
This query used to work with views 2. Should I downgrade or is there a fix for this?
Comments
Comment #1
dawehnerCan you please provide a way to reproduce the problem?
Before you make any module update please make a backup to be able to revert to the previous state.
Comment #2
ayukko commentedSure!
So this is the "fact chronology": I installed the Leaguesite module which provides a query. I tested it with views version 6.2.11 and worked just fine. Later on, I updated views to 6.x-3.x-dev. I have just tried the view again in order to modify it and then I got the error in the title.
After posting this issue, I tried to create a new view from scratch. I added the sort criteria and the filters just fine but then I added a "Global view result counter" field, saved the view and got the error message again (not getting it after saving for sort criteria and filters). Removed the field, added node:title and still getting it.
Is there anything I can provide you with to help you figuring out what is going on? In that case, just let me know. I am a newbie so I will need detailed instructions in case you need something else than a view export (using the export button on the views UI)
Comment #3
dawehnerMove to leaguesite.
if it's really a bug in views this issue can be moved back.
Comment #4
ayukko commentedExcuse my ignorance, what do you mean by "Move to leaguesite" and "move back"?
Comment #5
dawehnerSet the project of this issue to leaguesite :)
If someone can say that the bug is in views code and not something specific to leaguesite, it can be moved back to views.
Comment #6
ayukko commentedlol! thanks for the explanation. I have to learn how to "read" this post tool as well, I can see now the field project is "Leaguesite"
Comment #7
ayukko commentedHi there! just a friendly reminder this bug is still bitting.... thanks!
Comment #8
ddorian commentedwe all like the new features of views3 but many modules are not compatible and it is still alpha so.... downgrade?
Comment #9
Alun commentedI'm with ddorian on this, I haven't tested any of the module with Views 3, so it might be best to stick with Views 2 for the moment.
Alun
Comment #10
dawehnerJust from my perspective this should be a bug in views2 integration, too.
There aren't any api changes which might can cause this behavior.
Comment #11
ayukko commentedFurther news on this one... It bit me up again when building my view from scratch using latest dev version (17/02/2011). I added the field LeagueSite Standings: Points in the sorting section of the view and then got the error message. I had already added this field in the fields section and it worked fine.
Any ideas?
Comment #12
MasterChief commentedHi ayukko!
Could you make an export of the view and give it here ?
I will try to see the problem if you do it.
Comment #13
Alun commentedThis is not a problem with the construction of the view using the UI, I think this is a problem with a custom view handler I created for the points column.
The offending line I imagine is line 17 of leaguesite_handler_sort_points.inc in leaguesite_league/views/
Quite which operand is unsupported I don't know. I'm not sure what I need to change here. I'll have to have a look at it.
Alun
Comment #14
ayukko commentedHi there!
I have used the following work around which I found browsing drupal site and it works:
The piece of code biting in the /etc/drupal/6/sites/all/modules/views/plugins/views_plugin_query_default.inc on line 696" was
// Create a field info array.
$field_info = array(
'field' => $field,
'table' => $table,
'alias' => $alias,
) + $params;
I have updated the last line to ) + (array)$params; and it works fine now.
I have no idea why this works though, I am not a savvy php programer.
Let me know if you need something else I can help with.
Comment #15
ddorian commentedayukko the idea is that the problem is with leaguesite so you need to change leaguesite and not views
Comment #16
MasterChief commentedI am using the latest version of views 6.x-3.dev and i have this error on league_standings :
Fatal error: Unsupported operand types in C:\wamp\www\fts\mysite\all\modules\views\plugins\views_plugin_query_default.inc on line 702
Comment #17
MasterChief commentedOk i understand the problem,
Alun why don't you add a column "Points" in the table leaguesite_standings ?
The comment in #13 is the problem for me too, you can make a sort only on a data, if you make an operation each row the sql request will be very long and even i don't think it will work.
Comment #18
Alun commentedHi Masterchief,
adding points would be a pointless exercise, since points is derived from data that already exists in the database. It would cause data duplication, which would make adding and subtracting points (in the result of matches being edited and deleted) more difficult.
The issue goes on. I haven't installed Views 3 but when I do, I can assess this problem. At least we know whats causing it.
Alun