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.
I get the error pasted below when I do the following.
1. Create a new Org AA then save
2. Create a new Project B and assign it to existing Org B then save
3. Reopen Project B and change the Org from Org B to Org AA
Recoverable fatal error: Argument 2 passed to db_query() must be an array, string given, called in /media/sf_sandbox/pm/sites/all/modules/pm/pminvoice/pminvoice.module on line 292 and defined in db_query() (line 2342 of /media/sf_sandbox/pm/includes/database/database.inc).
Comment | File | Size | Author |
---|---|---|---|
#40 | 1996886-34.patch | 5.84 KB | Raphael Dürst |
#27 | 1996886-26.patch | 5.75 KB | Raphael Dürst |
#25 | 1996886-24.patch | 4.95 KB | Raphael Dürst |
#23 | 1996886-22.patch | 3.39 KB | Raphael Dürst |
#22 | pm-ticket.PNG | 34.91 KB | gapa |
Comments
Comment #1
juliangb CreditAttribution: juliangb commentedHere's a patch for this issue.
Comment #3
juliangb CreditAttribution: juliangb commented#1: pm-nodechange.patch queued for re-testing.
Comment #5
juliangb CreditAttribution: juliangb commentedTry rerolling. Locally I can't reproduce this error.
Comment #6
dbt102 CreditAttribution: dbt102 commentedPatch applied cleanly. When working through issue reporting scenario I get this message. (see attached printout ... includes Devel node access results)
Strict warning: Creating default object from empty value in pmproject_update() (line 584 of /media/sf_sandbox/pm/sites/all/modules/pm/pmproject/pmproject.module).
Strict warning: Creating default object from empty value in pmproject_update() (line 589 of /media/sf_sandbox/pm/sites/all/modules/pm/pmproject/pmproject.module).
Comment #7
juliangb CreditAttribution: juliangb commentedThanks for the feedback. I've committed the patch, and will post again to fix the warnings that you mention.
Comment #8
juliangb CreditAttribution: juliangb commented@dbt102 Would you mind checking this scenario again please?
I could not reproduce this just now, so either other issues have fixed the issues, or I need to use a specific way to trigger the problem.
Comment #9
juliangb CreditAttribution: juliangb commentedHopefully this issue is already fixed.
Comment #10
gapa CreditAttribution: gapa commentedI too have this (or similar) problem. I just tried PM module and I have created new organization, new person, and new project. If I try to view created project I get WSOD. And if I try to edit it and save it I get this message:
Warning: Creating default object from empty value in pmproject_update() (line 580 of /var/www/clients/client1/web33/web/sites/all/modules/pm/pmproject/pmproject.module).
It seems that I cannot save price amount. Everytime I try to save value for price I get this error. So I guess this issue is not closed.
Comment #11
juliangb CreditAttribution: juliangb commentedReopening issue.
Comment #12
juliangb CreditAttribution: juliangb commentedI still can't reproduce this.
Please could you post detailed instructions for how to see this error?
Comment #13
gapa CreditAttribution: gapa commentedI have created organization, one person (people) in one organization, and one project. I have filled fields for project like in picture. If I try to edit this project I can (can't save hourly price thoug), if I try to view it I get WSOD.
Comment #14
dbt102 CreditAttribution: dbt102 commentedI'm not able to reproduce this (#13) exactly, however seems if I go into an existing project and change the price mode - say from hourly to daily - then save ... there is a warning that pop up. (see attached)
Comment #15
juliangb CreditAttribution: juliangb commentedTo summarise points outstanding:
1 - Cannot view project - WSOD - I cannot reproduce this error.
2 - Cannot save price field - I have reproduced this error
3 - Warning after save - I cannot reproduce this error
I will try again on a fresh installation, and see if that helps to see this.
I am currently testing on the demo site (http://drupal-7.project-management-module.org/)
Comment #16
gapa CreditAttribution: gapa commentedI have also installed on fresh installation. But problems still remains. I also send you (juliangb) admin access for my test site.
Comment #17
gapa CreditAttribution: gapa commentedI also tried on my local machine (xampp,win7) and still have the same problem. With first alpha release.
Comment #18
juliangb CreditAttribution: juliangb commentedI have now tried this on a fresh installation, and also cannot reproduce the error, although did see the error when trying on your site. When the error occurs, there is no log message saying what has happened.
I also noted on your site the warning message that @dbt102 has seen.
Therefore, I'm a bit confused - I can see that there is a problem, but cannot reproduce it myself at the moment.
I notice that we're using different versions of PHP, which could potentially cause something like this.
It would be ideal if others that see this issue could post as well, and hopefully then we can narrow down what is going on.
Comment #19
Raphael Dürst CreditAttribution: Raphael Dürst commentedCould this have something to do with this?
Line 578 in pmproject.module:
$node->manager_nid is inside a string (which is really not necessary), maybe this causes problems with some PHP versions.
Edit: I just realized, that the variable is inside a single-quoted string. There is no way, this is working (variables can only work in double-quoted strings).
Comment #20
Raphael Dürst CreditAttribution: Raphael Dürst commentedHere's a patch. I'm not sure, if this actually fixes this issue, but it can't hurt either.
Comment #21
juliangb CreditAttribution: juliangb commentedThanks for that - looks like a change we should make anyway.
@dbt102 and @gapa, could you test to see if this solves either problem please?
Comment #22
gapa CreditAttribution: gapa commentedThis patch solved only that it didn't display warning after save. But price value is still not saved.
I have tried many different things. Last thing that I tried was to uninstall all module but pmorganization and pmproject. And then I tried to create new project. I could create it and view it (finaly) but I recived this message:
Warning: Creating default object from empty value in pmproject_update() (line 582 of /var/www/clients/client1/web33/web/sites/all/modules/pm/pmproject/pmproject.module).
Warning: Creating default object from empty value in pmproject_update() (line 587 of /var/www/clients/client1/web33/web/sites/all/modules/pm/pmproject/pmproject.module).
And also if I had all pm modules enabled and I tried to create new ticket i recived this message:
Notice: Trying to get property of non-object in pmticket_update() (line 595 of C:\xampp\htdocs\pm\sites\all\modules\pm\pmticket\pmticket.module).
I could edit ticket and after save I recived upper error, and I couldn't view it. I got error message (on the picture)
All this I tried on local machine (xampp 3.2.1.) and production server (debian wheezy). Same results.
Any idea? What else can I try?
Comment #23
Raphael Dürst CreditAttribution: Raphael Dürst commentedSaving the price & duration values were commented out (in hook_insert & hook_update) for some reason.
It's working now with this patch.
This error only appears, when
E_STRICT
warnings are enabled. I guess, that's the reason, only you saw these.It tries to assign a value to the property title of a non-existing object (
$manager
/$assigned
).I just created the object before assigning a value.
It tries to get a value from the object
$p
which doesn't exist. Fixed this as well.Other fixes: Price in pmticket was also not saved.
In pmtask_pmproject_change, it tries to update the pmproject table, when it should've updated the pmtask table.
Comment #24
gapa CreditAttribution: gapa commentedI tried with your patch. I uninstalled pm modules, deleted old content and tried with patched modules. I created 2 organization and 1 person successfully, but when I tried to create new project I recived this:
PDOException: SQLSTATE[01000]: Warning: 1265 Data truncated for column 'price' at row 1: INSERT INTO {pmproject} (vid, nid, organization_nid, organization_title, projectcategory, projectstatus, projectpriority, pricemode, price, currency, durationunit, duration, manager_nid, manager_title, assigned_nid, assigned_title, billable, billed) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6, :db_insert_placeholder_7, :db_insert_placeholder_8, :db_insert_placeholder_9, :db_insert_placeholder_10, :db_insert_placeholder_11, :db_insert_placeholder_12, :db_insert_placeholder_13, :db_insert_placeholder_14, :db_insert_placeholder_15, :db_insert_placeholder_16, :db_insert_placeholder_17); Array ( [:db_insert_placeholder_0] => 16 [:db_insert_placeholder_1] => 16 [:db_insert_placeholder_2] => 12 [:db_insert_placeholder_3] => Jotajomo Gašper Žnidaršič Bečaj s.p. [:db_insert_placeholder_4] => development [:db_insert_placeholder_5] => inserted [:db_insert_placeholder_6] => 1-low [:db_insert_placeholder_7] => not applicable [:db_insert_placeholder_8] => [:db_insert_placeholder_9] => USD [:db_insert_placeholder_10] => hour [:db_insert_placeholder_11] => [:db_insert_placeholder_12] => 0 [:db_insert_placeholder_13] => [:db_insert_placeholder_14] => 0 [:db_insert_placeholder_15] => [:db_insert_placeholder_16] => 0 [:db_insert_placeholder_17] => 0 ) in pmproject_insert() (line 548 of C:\xampp\htdocs\pm\sites\all\modules\pm\pmproject\pmproject.module).
And project didn't create at all.
This was tested localy (xampp).
Comment #25
Raphael Dürst CreditAttribution: Raphael Dürst commentedOk, this happened, because you didn't set a value for price (or duration). You would receive the same error, if you'd put in any non-numeric values.
I also added a check for non-numeric values, and if the value is invalid, it just set 0.
We can add proper form validation in a later step, I think.
Comment #26
gapa CreditAttribution: gapa commentedDid the same procedure as before. With uninstalling and recreating content. With saving I recive this error:
Fatal error: Unsupported operand types in C:\xampp\htdocs\pm\includes\theme.inc on line 1075
Call Stack
# Time Memory Function Location
1 0.0000 136776 {main}( ) ..\index.php:0
2 0.2030 2337872 menu_execute_active_handler( ) ..\index.php:21
3 0.2040 2338496 call_user_func_array ( ) ..\menu.inc:517
4 0.2040 2338680 node_page_view( ) ..\menu.inc:517
5 0.2060 2345704 node_show( ) ..\node.module:2760
6 0.2060 2346008 node_view_multiple( ) ..\node.module:1478
7 0.2180 2372104 node_view( ) ..\node.module:2676
8 0.2180 2372168 node_build_content( ) ..\node.module:1343
9 0.2190 2373008 node_invoke( ) ..\node.module:1418
10 0.2190 2373112 pmproject_view( ) ..\node.module:921
11 0.2250 2438344 theme( ) ..\pmproject.module:725
12 0.2310 2694288 theme_pmproject_view( ) ..\theme.inc:1146
13 0.2320 2696864 theme( ) ..\pmproject.theme.inc:62
But projects gets saved (also price is saved). And I receive this error also on view.
So I guess it is getting better, but not there yet.
Thanks for your patches.
Comment #27
Raphael Dürst CreditAttribution: Raphael Dürst commentedDid you have the pminvoice module enabled?
One theme function was not called correctly, but I didn't get your error. Strange...
I fixed it in this patch. Could you try it and look if you still get this error? Thanks!
Comment #28
gapa CreditAttribution: gapa commentedI think that this patch solved problems with project creation.
But... :)
With creating ticket (only fields that are marked with red *) I again recive this message:
Fatal error: Unsupported operand types in C:\xampp\htdocs\pm\includes\theme.inc on line 1075
Call Stack
# Time Memory Function Location
1 0.0000 136776 {main}( ) ..\index.php:0
2 0.1200 2360872 menu_execute_active_handler( ) ..\index.php:21
3 0.1200 2361496 call_user_func_array ( ) ..\menu.inc:517
4 0.1200 2361680 node_page_view( ) ..\menu.inc:517
5 0.1220 2368712 node_show( ) ..\node.module:2760
6 0.1220 2369016 node_view_multiple( ) ..\node.module:1478
7 0.1270 2395112 node_view( ) ..\node.module:2676
8 0.1270 2395176 node_build_content( ) ..\node.module:1343
9 0.1270 2396016 node_invoke( ) ..\node.module:1418
10 0.1280 2396120 pmticket_view( ) ..\node.module:921
11 0.1310 2465064 theme( ) ..\pmticket.module:775
12 0.1350 2720896 theme_pmticket_view( ) ..\theme.inc:1146
13 0.1350 2723472 theme( ) ..\pmticket.theme.inc:62
when I go back I recive this error:
Notice: Undefined property: stdClass::$datebegin in _pmticket_beforesave() (line 707 of C:\xampp\htdocs\pm\sites\all\modules\pm\pmticket\pmticket.module).
Notice: Undefined property: stdClass::$dateend in _pmticket_beforesave() (line 708 of C:\xampp\htdocs\pm\sites\all\modules\pm\pmticket\pmticket.module).
Notice: Undefined property: stdClass::$datebegin in pmticket_insert() (line 556 of C:\xampp\htdocs\pm\sites\all\modules\pm\pmticket\pmticket.module).
Notice: Undefined property: stdClass::$dateend in pmticket_insert() (line 557 of C:\xampp\htdocs\pm\sites\all\modules\pm\pmticket\pmticket.module).
if I try to edit this ticket and save it (without any change) I don't recive any error. But I cannot view it.
And when I try to create task I recive this:
Notice: Undefined property: stdClass::$datebegin in _pmtask_beforesave() (line 778 of C:\xampp\htdocs\pm\sites\all\modules\pm\pmtask\pmtask.module).
Notice: Undefined property: stdClass::$datebegin in _pmtask_beforesave() (line 782 of C:\xampp\htdocs\pm\sites\all\modules\pm\pmtask\pmtask.module).
Notice: Undefined property: stdClass::$dateend in _pmtask_beforesave() (line 785 of C:\xampp\htdocs\pm\sites\all\modules\pm\pmtask\pmtask.module).
Notice: Undefined property: stdClass::$dateend in _pmtask_beforesave() (line 789 of C:\xampp\htdocs\pm\sites\all\modules\pm\pmtask\pmtask.module).
Also this error is shown when I view this task.
And again if I try to edit and save all is ok. But this time I don't receive any error on view.
So I guess this happens only with first save.
Comment #29
Raphael Dürst CreditAttribution: Raphael Dürst commentedWell, this issue (and patch) is about projects.
I think, we should commit this patch (if there are no errors) and open another issue for other errors.
Comment #30
D34dMan CreditAttribution: D34dMan commented@Raphael, will you please assign the issue to yourself if you are working on it. ( and anybody who is working on any issue for that matter). I intend to clean up few issues and don't want to duplicate efforts. Thank you. Thanks for the patches you are awesome.
Comment #31
dbt102 CreditAttribution: dbt102 commentedApplied patch (#27) cleanly. This was done after 'git reset --hard' then 'git pull origin'.
Created new project, making sure to fill in all variables, and this saved without throwing any errors.
Then, went back and created new project , this time filling out the minimal # of fields.
This worked OK for me too,
Awesome work!
Comment #32
dbt102 CreditAttribution: dbt102 commentedAlso, ran coder check on PMProject ...
Coder reports ...
"Coder found 1 projects, 6 files, 17 normal warnings, 0 warnings were flagged to be ignored "
So looks good to me from that perspective also...
Comment #33
gapa CreditAttribution: gapa commentedCan this also be commited to dev?
Comment #34
juliangb CreditAttribution: juliangb commentedThis patch doesn't apply - perhaps due to the other issues that I've already committed.
Could we reroll please?
@D34dMan Thanks for the reminder on assigning issues - I've been getting forgetful on this myself.
@Raphael I've assigned this one to you (hope that's OK)
Comment #35
gapa CreditAttribution: gapa commentedI just tested with alpha1 version. with no problems. I will try later with newest dev version.
Comment #36
D34dMan CreditAttribution: D34dMan commented#27: 1996886-26.patch queued for re-testing.
Comment #38
Raphael Dürst CreditAttribution: Raphael Dürst commentedOk, I guess that's because of other patches that were committed.
I'll fix the patch and upload it again later.
Comment #39
gapa CreditAttribution: gapa commentedI think that the problem is in pmticket.module section of the patch.
diff --git a/pmticket/pmticket.module b/pmticket/pmticket.module
index 2b77e4f..cbfdb36 100644
--- a/pmticket/pmticket.module
+++ b/pmticket/pmticket.module
@@ -556,9 +556,9 @@ function pmticket_insert($node) {
'datebegin' => $node->datebegin,
'dateend' => $node->dateend,
'durationunit' => $node->durationunit,
-// 'duration' => $node->duration,
+ 'duration' => $node->duration,
'pricemode' => $node->pricemode,
-// 'price' => $node->price,
+ 'price' => $node->price,
'currency' => $node->currency,
'assigned_nid' => $node->assigned_nid,
'assigned_title' => $node->assigned_title,
This part of code was giving me errors. But I was unable to fix it for some unknown reason.
Comment #40
Raphael Dürst CreditAttribution: Raphael Dürst commentedI fixed the patch, it should now apply to the current HEAD.
Comment #41
gapa CreditAttribution: gapa commentedIt does apply with no problems.
Thank you.
Comment #42
dbt102 CreditAttribution: dbt102 commentedApplied patch (#40) cleanly. This was done after 'git reset --hard' then 'git pull origin'.
Created new project, making sure to fill in all variables, and this saved without throwing any errors.
Then, went back and created new project , this time filling out the minimal # of fields.
This worked OK for me too,
Again...Awesome work!
Comment #43
juliangb CreditAttribution: juliangb commentedThanks, I've committed this patch.
So - this will be in the -dev release from midnight, and the next point release from early August.