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.
Each time I submit a new node (and not necessarily an issue node), I have the following warning:
warning: implode() [function.implode]: Bad arguments. in sites/all/modules/project_issue/project_issue.views.inc on line 147.
I don't use views (views is not listed as a requirement yet, for project_issue) , so I wonder why the .inc file is called at all.
Comments
Comment #1
beginner CreditAttribution: beginner commentedCorrection: views.module was indeed enabled on the site. Looking at the code, the contrary would have been surprising.
I have turned off views since I don't actually need it, so that solves my problem.
The bug probably remains, though.
Comment #2
aclight CreditAttribution: aclight commentedThe only way I can see this error message coming about is if you had no statuses defined at /admin/project/project-issue-status or if you modified your db so that none of the statuses were included in the default query.
Are either of these the case on your site?
Comment #3
beginner CreditAttribution: beginner commentedNo.
In /admin/project/project-issue-status I have I guess a standard setup: many statuses, several in default queries, one default status, etc.
I don't recall making any change anywhere that would affect this issue.
I reenabled views for a while to check if the other administrator had created another view for testing purposes that could have accounted f or this, but I couldn't find anything but default views.
Maybe it's a worksform problem. I can't say more that could be helpful, but if you're sure this bug shouldn't occur, maybe it's still something on our site that causes it and you can won't fix this issue.
Comment #4
aclight CreditAttribution: aclight commentedLine 148 in project_issue.views.inc is the line in HEAD that is causing problems for you, I believe. I suspect that you have not updated your code since a fairly recent one line commit to the module was made. Here is that line:
Since your error message says that implode has bad arguments, that must mean that the return value of
project_issue_state(0, false, false, 0, true)
is NULL, because that is the only way I was able to get implode to give me the same error you reported.Here is the code of project_issue_state():
In this particular invocation of the function, the $defaults parameter is TRUE, so the code that gets executed within the foreach block is this:
The return value of the function is this:
Because the $sid parameter to the function is 0, $states will always be the return value. The only way I see that $states could be NULL is if you have either no statuses, so nothing within the foreach loop gets executed, or you have no states that are in the default query, in which case $states won't be populated, and since it's not initialized earlier in the function it will be NULL.
Am I missing something obvious here? Can you make sure that the line you're getting the error on is the same line I pasted at the top of this comment? Also, maybe you can debug a bit in project_issue_state() and see if you can figure out what is going on.
Ideally, we would initialize $state to be array() at the top of the function, and for the D6 version we will have to to prevent notices, but I don't see how this would actually matter if your states are as you tell me they are.
Comment #5
beginner CreditAttribution: beginner commentedyes, the line is the same (sorry, I should have pasted it earlier).
I had updated the site to the latest 5--2 version from cvs update 2 or 3 weeks ago.
Sorry: I don't have time to investigate more right now. My business premises where I write from got flooded twice in two days. I just got back online for a short while yesterday, and again a few minutes ago. I am among the lucky ones, but I have a few things to attend to as a result of the flooding.