After installing charts-6.x-1.0-alpha6.tar on Drupal 6.12
I have in /admin/settings/charts these messages:
* warning: Wrong parameter count for explode() in /virt/homes/*/htdocs/sites/all/modules/charts/charts.inc on line 120.
* warning: array_shift() [function.array-shift]: The argument should be an array in /virt/homes/*/htdocs/sites/all/modules/charts/charts.inc on line 121.
* warning: preg_match() expects parameter 2 to be string, array given in /virt/homes/*/htdocs/includes/bootstrap.inc on line 771.
In /admin/reports/status I have
Charts Charts module not yet configured
Charts core module needs to get some default options in order to operate. You must go to settings page and configure it.
But still warning being is not so good.
Comment | File | Size | Author |
---|---|---|---|
#17 | charts_php52.patch | 607 bytes | jenlampton |
#3 | charts.inc_.diff | 153 bytes | Surrogard |
Comments
Comment #1
ISchier770 CreditAttribution: ISchier770 commentedBS"D
I have the exact same issue as well. Please advise. Thanks.
Comment #2
ISchier770 CreditAttribution: ISchier770 commentedComment #3
Surrogard CreditAttribution: Surrogard commentedSolution is:
change line 120 in "chart.inc" from
$default['#color'] = explode($default['#color_palette']);
to
$default['#color'] = explode(',', $default['#color_palette']);
note the first parameter of "explode" which is the delimiter and needed...
diff attached
Comment #4
Surrogard CreditAttribution: Surrogard commentedComment #5
landike CreditAttribution: landike commentedYes. This replacing helps.
All related Charts sub-modules and additional modules installed successuflly.
Need to review and test in use
Comment #6
landike CreditAttribution: landike commentedOn admin/reports/status
I have
So i went to admin/settings/charts
And here is a message
warning: preg_match() expects parameter 2 to be string, array given in /var/www/****/includes/bootstrap.inc on line 771.
Looks like not so good with settings code for Charts module
Please take acre about it or inform how to fix it or when will be new release of Chart's modules
Comment #7
reubenavery CreditAttribution: reubenavery commentedI determined that this is coming from fushioncharts.inc, line 129. Its passing an array of an array and that is what is ending up going to drupal_validate_utf8 where the error is occuring.
Comment #8
brmassa CreditAttribution: brmassa commentedGuys,
the original bug on settings page fixed. thanks Stefan
regards,
massa
Comment #10
gopagoninarsing CreditAttribution: gopagoninarsing commentedHi,
I am getting the same error as mentioned in #6.
can u provide the solution for this error.
-Narsing
Comment #11
leamas CreditAttribution: leamas commentedI don't know if this will help, but I ran into this problem and it was resolved without using the suggestion above.
on the admin/settings/charts page, I kept getting this error until I selected Google Chart and Pie 2D then hit the Save Settings
Once I did that, the error disappeared and has not come back.
Comment #12
aabstewart CreditAttribution: aabstewart commentedThis also fixed the problem for me...just one extra step. I needed to clear the cache in admin/settings/performance.
Comment #13
eMPee584 CreditAttribution: eMPee584 commentedBTW if you have not yet activated any chart modules, the settings page will be blood red from php errors. Please add
to your settings.php to show all these PHP warnings and test a bit around.
Comment #14
awakenedvoice CreditAttribution: awakenedvoice commentedI'm seeing the error message from #6. I tried the fix from #3 to no avail. Guidance on another possible fix is greatly appreciated.
I only see the error when Fusion Charts is selected as charting program. I do not see the error when selecting Google Charts or Open Flash Charts.
Comment #15
landike CreditAttribution: landike commentedSo? How is with this issue?
It is still active?
I want use this module in future. But not know, failed.
Comment #16
bribiz CreditAttribution: bribiz commentedThis is the error I get when I turn on error reporting:
Fatal error: Call to undefined function array_fill_keys() in /chroot/home/mysite/mysite.com/html/sites/all/modules/charts/charts.inc on line 103
Function array_fill_keys is available only in php 5.2 and above. See:
http://php.oregonstate.edu/manual/en/function.array-fill-keys.php
To work around it I added the following to the bottom of the charts.inc file:
/**
* To make compatible with < PHP 5.2
*/
function array_fill_keys($target, $value = '') {
if(is_array($target)) {
foreach($target as $key => $val) {
$filledArray[$val] = is_array($value) ? $value[$key] : $value;
}
}
return $filledArray;
}
This worked for me. Hope it helps someone else
Comment #17
jenlamptonHaving the same issue as #16, thanks for posting the fix!
I've turned it into a patch for review.
Jen
Comment #18
kreynen CreditAttribution: kreynen commentedI had this problem too and this change fixed it.
Comment #19
jfev CreditAttribution: jfev commentedI'm on the verge of getting this working, but I keep getting a User Error no matter how I configure the Chart style settings in views. I've applied the patch which seems to have taken away the line 120 error. I've tried different combinations of fields and settings, but no luck. It seems like I'm just setting up the view wrong or something? Below is the error I get currently. I'm not a developer so this is all jibberish to me. Thanks for the help.
user warning: Can't group on 'field_fish_lbs_value' query: SELECT node_data_field_fish_lbs.field_fish_lbs_value AS node_data_field_fish_lbs_field_fish_lbs_value, ROUND(COUNT(node_data_field_fish_lbs.field_fish_lbs_value), 2) AS field_fish_lbs_value FROM node node LEFT JOIN content_type_fish node_data_field_fish_lbs ON node.vid = node_data_field_fish_lbs.vid LEFT JOIN content_type_fish node_data_field_fish_lbs2 ON node.vid = node_data_field_fish_lbs2.vid WHERE (node.status <> 0) AND (node.type in ('fish')) GROUP BY node_data_field_fish_lbs.field_fish_lbs_value, node_data_field_fish_lbs_field_fish_lbs_value, field_fish_lbs_value ORDER BY node_data_field_fish_lbs_field_fish_lbs_value ASC in /homepages/13/d543254080/htdocs/mysite/sites/all/modules/views/plugins/views_plugin_query_default.inc on line 1094.
Comment #20
landike CreditAttribution: landike commentedHow is going with this issue?
Will be in Drupal 7 fixed ??? :)
Comment #21
SocialNicheGuru CreditAttribution: SocialNicheGuru commented#3 works for me.
Should it be committed?
Comment #22
ezra-g CreditAttribution: ezra-g commentedSeveral people have said this fixes the problem and the fix seems somewhat unsignifigant. This is probably RTBC.
Comment #23
slip CreditAttribution: slip commented#3 makes sense to me although I think the relevant code may have changed in cvs.
Seems like #17 will break the module for people with php 5.2 because you're redefining a function that already exists.
Comment #24
webchickYeah, this needs to be wrapped in an if (!function_exists(...)) call.
Comment #25
tiato CreditAttribution: tiato commentedUsing PHP4.4.9 and Drupal 6 I had to apply #3 and #16, both solutions worked perfect for me, not getting any errors and the module is working great
Great work!
Comment #26
kenorb CreditAttribution: kenorb commentedThe same problem.
Clear cache doesn't helped.
My code:
Comment #27
verta CreditAttribution: verta commentedI am seeing the
warning: preg_match() expects parameter 2 to be string
in the admin/settings/charts page also.
I tried the fix in #3 and cleared cache in admin/settings/performance and it did not fix the problem.
I don't have Google charts as an option, possibly because my server is behind a firewall. If this is going to keep me from being able to use the module, please let me know, or indicate the sites I have to allow?
Comment #28
verta CreditAttribution: verta commentedI should add that fix #3 changed the error from chart.inc to bootstrap.inc:
warning: preg_match() expects parameter 2 to be string, array given in {} includes\bootstrap.inc on line 777.
That line is a regex that I haven't decoded, but it looks like it's still sending something null up the chain of command. Maybe just a check for this condition would help?
777: return (preg_match('/^./us', $text) == 1);
Comment #29
fuquam CreditAttribution: fuquam commentedSubscribing.
Fix #3 seemed to do the trick. At least no errors.
#16 gave me "Fatal error: Cannot redeclare array_fill_keys() in /home2/(site)/public_html/sites/all/modules/charts/charts.inc on line 154"
Comment #30
sickhippie CreditAttribution: sickhippie commentedI'm getting the same results as verta in #29. I applied fix #3, which cleared up the first issue (which only appeared on fusioncharts, or open flash if no chart type was selected). Selecting Google Charts clears up the error. However, ideally I'd like to use fusion - hopefully someone can come up with a fix for this. I don't have time at the moment to dig into it more, but if I find a solution, I will be sure to report back here.
Comment #31
vasheck CreditAttribution: vasheck commentedhi guys,
After installing the Charts module, I got the following error:
on this page: admin/settings/charts
after using #3 fix:
the error changed to:
Despite the fact that I'm using PHP 5.2.13... I tried to use fix #16 to see what happens and #16 fix breaks stuff for me. I get a completely white/blank page...
(admin/settings/charts) I do see Google Charts, but I don't see any charts for Open Flash Charts or FusionCharts.
Any hints how to get this fixed would be greatly appreciated.
Thanks!
Comment #32
vasheck CreditAttribution: vasheck commentedalright, going over here... admin/settings/open_flash_chart_api and uploading the files from the instructions to "sites/all/libraries/ofcv1" got the Open Flash Charts working...
*note: I used files from open-flash-chart-1.9.7
However, my FusionCharts option is still busted... I'd like to get to the bottom of this... I'll keep poking around... if I run into anything useful (or a solution), I'll post here.
Thanks!
Comment #33
kenorb CreditAttribution: kenorb commentedDuplicate: #463404: Problem with alpha6 release
Comment #34
vasheck CreditAttribution: vasheck commentedanother update about my struggle to get FusionCharts working... (continuation on #31 & #32)
1) I downloaded the free version of FusionCharts (http://www.fusioncharts.com/free/download/).
2) extracted the folder
3) copies "Charts" folder from "FusionChartsFree" to "modules/charts/fusioncharts"
4) renamed "Charts" to "swf" (so that I have: modules/charts/fusioncharts/swf)
5) cleared cache / ran cron ... the error message persists..
Comment #35
ClearXS CreditAttribution: ClearXS commented6.x-1.0-alpha6 => .../admin/settings/charts:
OK: ticked-off sub-module FusionCharts 6.x-1.0-alpha6 =>
(probably means that fusion chart sub module is missing?)
OK: ticked off all Chart modules and Bench Chart, then: .../admin/build/modules/uninstall +rebuild perm.+update+cron
=> installed & ticked on the 'very latest' 6.x-1.x-dev (2009-Jul-14) +rebuild-perm.+update+cron
I'm not sure anymore if I installed Fusion-charts before: http://www.fusioncharts.com/jquery/ - Eh NO; use the other link of the former poster!
Readme.txt: "Note: the flash file is not included with this module. It should be downloaded separatedly."
=> extract in charts, copied all the contents of FusionChartFree to fusionchart.
ticking the modules on:
OK; tick-off all sub-modules and uninstall (the WSOD was not on all pages). No idea what caused this error, but not enough time to test all possibilities. So again with the version I had before; 6.x-1.0-alpha6; ticking on all sub-modules +SWF Tools except for fusioncharts:
user warning: Table 'cache_swftools' already exists query: CREATE TABLE cache_swftools ( `cid` VARCHAR(255) NOT NULL DEFAULT '', `data` LONGBLOB DEFAULT NULL, `expire` INT NOT NULL DEFAULT 0, `created` INT NOT NULL DEFAULT 0, `headers` TEXT DEFAULT NULL, `serialized` SMALLINT NOT NULL DEFAULT 0, PRIMARY KEY (cid), INDEX expire (expire) ) /*!40100 DEFAULT CHARACTER SET UTF8 */ in .../includes/database.inc on line 550.
I don't understand; thought I had removed the module swftools properly? Are these modules or drupal errors, or is something wrong with my hoster causing ghost-errors?
/admin/settings/charts:
But I see a chart now; as fusion-charts misses, a Google test chart is shown.
Applied fix#3 adding ',', in line 120 of charts.inc =>
Perfect! Works for me; NO other error messages shows up like some other report...
But then:
OK, site unworkable again; going back to the chart page works, but the change back to google maps is not accepted. So removing and reinstalling these modules again, except for fusion charts => works without errors with google charts.
Now activating fusion charts again=> admin/settings/charts =>
warning: htmlspecialchars() expects parameter 1 to be string, array given in .../includes/bootstrap.inc on line 840.
Well; a relatively 'acceptable' error, as fusion charts is selected, no graph shown but this error & NO major error affecting the whole site...
??! I have PHP 5.2.13 (.13 is higher than .5) WHY IS AN ERROR GENERATED WITH THE CHARTS MODULE?
I suppose I should not remove this in Drupal, but remove/change something in Charts that must be the cause of this?
Comment #36
ClearXS CreditAttribution: ClearXS commented"Seems like #17 will break the module for people with php 5.2 because you're redefining a function that already exists."
"Yeah, this needs to be wrapped in an if (!function_exists(...)) call."
"That line is a regex that I haven't decoded, but it looks like it's still sending something null up the chain of command. Maybe just a check for this condition would help?
777(now 840): return (preg_match('/^./us', $text) == 1);"
840: return htmlspecialchars($text, ENT_QUOTES, 'UTF-8');
I have no idea about programming with these codes; what should I do?
Changing that line 840(former 777) in the proposed one =>
But this shouldn't be changed in Drupal core? Is this a Drupal core error?
OK then; I will file this as a Drupal error and see how the folks respond...
But the fix ain't working; a lot of "1"s on the Charts page and:
warning: preg_match() expects parameter 2 to be string, array given in /includes/bootstrap.inc on line 840.
OK then, delete the whole 5.2.5 fix; deleted:
=>
warning: preg_match() expects parameter 2 to be string, array given in /includes/bootstrap.inc on line 832.
OK, then delete the whole thing:
=>
Fatal error: Call to undefined function check_plain() in .../includes/bootstrap.inc on line 441
Now removing only this part:
So that this remains:
=> NO MORE ERROR message on Charts page... But most texts are missing (that were transsfered by strings), like the different charts.
Then the other question is where fusioncharts plugin/library should be extracted and how it should be renamed; nothing in the documentation about this?
Comment #37
ClearXS CreditAttribution: ClearXS commentedOK, they found a 'solution' for the last remaining error message, for Drupal 6.17 it is:
http://drupal.org/node/525036#comment-3046610
Change includes/bootstrap.inc line 842
return (preg_match('/^./us', $text) == 1) ? htmlspecialchars($text, ENT_QUOTES, 'UTF-8') : '';
Into:
return (preg_match('/^./us', (string) $text) == 1) ? htmlspecialchars((string) $text, ENT_QUOTES, 'UTF-8') : '';
SO NOW THE QUESTION REMAINS, HOW TO GET FUSION CHARTS WORKING ?
How is it being called? Should swf being under swf tools module instead of fusion charts sub-module?
Comment #38
ClearXS CreditAttribution: ClearXS commentedAnother error might be the direction of the swf files. Already has been pointed out that the containing directory has to be renamed in "swf".
/sites/all/modules/charts/fusioncharts/fusioncharts.inc:
FIRST: The names of the files seem to be WRONG; the real files have the addition "FSF_" in front of them.
BUT: changing the names, doesn't return any chart...
Is the directory correct? Does "/" mean the servers root, Drupal root, the chart module root, or the fusioncharts root?
Here it is making the exact path:
$file = url(drupal_get_path('module', 'fusioncharts') . $options[$data['#type']]);
Well, I dont know about these coding, but a simple way to check is just fill in a url and see if a graph shows up:
$file = "http://...../sites/all/modules/charts/fusioncharts/swf/FCF_MSBar2D.swf";
or something?=> no chart shows up
Here is the documentation file on your site:
http://..../sites/all/modules/charts/fusioncharts/Index.html
Try the direct link to a fusioncharts swf:
http://..../sites/all/modules/charts/fusioncharts/swf/FCF_MSBar2D.swf
"Retreiving data, please wait => Error in loading data"
So the data can´t be found? And why Drupal ain't showing these messages?
Ach so... WWOOOOWWWHHH !!!
Ok I saw them, I've seen them now! So how to implement? =>
- Bring fusioncharts.swf back in original state (without FCF_ in front of file names)
- Copy the necessary files for fusioncharts.swf from /Gallery to /swf
=> nothing shows up on the site, even not when short-cutting that $file on two different places...
ANYWAY: WHO KNOwS PHP CODING; HERE IS HOW TO REWRITE THE SUB-MODULE:
http://yoursite.org/sites/all/modules/charts/fusioncharts/Contents/First...
Comment #39
ClearXS CreditAttribution: ClearXS commentedTHE ANSWER:
FusionCharts FusionCharts flash files not installed
Put all flash files inside sites/default/files/fusioncharts.
=> error message doesn't disappear; for this message its only looking for MSline.swf
=> renaming all necessary files and deleting FCF_ in front of them and in above dir
=> recheck fusioncharts.inc for the same filenames
=> NO, Still nothing on admin/settings/charts
BUT: admin/reports/charts/hook_stat => works partially !
(some performance reporting; dont know with what module it works together there)
Comment #40
brmassa CreditAttribution: brmassa commentedGuys,
jezz! what a hot topic. sorry everybody for taking so long to fix it. Both array_fill_keys() and the explode() bugs are now fixed.
best regards,
massa
Comment #41
ClearXS CreditAttribution: ClearXS commentedThanks Massa! - I got what hyperactive without having the knowledge how to fix it myself...
In the mean time I have found many other graphic modules, one even especially dedicated to FusionCharts:
http://drupal.org/project/fusioncharts
http://drupal.org/project/charts_graphs
http://drupal.org/project/graphstat
maybe I forgot a few and then there are many statistics modules that do all this work again over themselves.
OK, I should put this in a separate issue on all projects pages, a comparing wiki, or something..?
Think its better that the developers try to integrate their modules, instead of that all down to nitwit users have to figure out what module suits them best?
Comment #42
webchickOff-topic, but that's a great idea. There's a group dedicated to doing reviews about similar modules: http://groups.drupal.org/similar-module-review. A run-down of charting modules and their pros/cons would be awesome.
Karen Stevenson also gave a run-down a few months ago: http://www.lullabot.com/articles/drupal-charting and there might be some stuff you could pull from there.
Probably make a separate issue to ask the maintainer to clarify Charts' placement in the overall list of other chart modules, similar to how http://drupal.org/project/menu_block has.
Thanks for fixing this, brmassa!
Comment #43
eMPee584 CreditAttribution: eMPee584 commentedMoving to a community-based development model (i.e. doing away with the concept of individual module 'ownership') for D7 contrib modules would have been, that might have been a grand chance to exit the duplicate-modules/patch-rot hell that is D6. Instead, same problem spinning another round. The D7CX campaign will surely result in a lot of D7 compatible modules on the day of 7.0 - but that's not necessarily a good thing.
Now all my hope is on the toolchain (module page with rating+functionality documentation+finegrained filtering, autotesting including checks for coding standards and PHP_ALL compliance).
Comment #44
brmassa CreditAttribution: brmassa commentedClearXSClearXS, Angie and eMPee584,
great! I support the idea of clarifying users about the difference of all charting solutions. 100%. If someone create a page on Drupal documentation area, i would put it in the module description page right way (its better than create a custom "equivalent modules" list). Any news about it, let me know.
I imagine how great it would be if Drupal.org put, on every module page, a rank/score for code compliance, existing testing suites and other indicatives of quality (calculated automatically with coder module and stuff). Users would have a great reference of who is who and would pressure programmers to be more committed to the solutions.
best regards to all,
massa
Comment #46
Pierre.Vriens CreditAttribution: Pierre.Vriens commentedSome updates from the new charts (co-)maintainer, for anybody still following this issue that at some time appeared to be a "hot topic":
PS 1: Charts are to Views what Views are to Core ...
PS 2: Chart (26K sites) + ChartS (9K sites) = Chart(s) (35K sites) ...