This module cannot be run on as postgres as it generates errors:

pg_query() [<a href='function.pg-query'>function.pg-query</a>]: Query failed: ERROR: null value in column &quot;value&quot; violates not-null constraint v /var/www/petrol/drupal/includes/database.pgsql.inc v vrstici 139.
query: UPDATE drupal_fillpdf_forms SET title = &quot;pogodba_mpo_2012-fields.pdf&quot;, destination_path = &quot;&qu

All of these errors are as a result of the fact that postgres, unlike mysql does not tolerate anything. This is a common error, i have reported 3 of this type this month alone.

A quick fix is to do this:
In table : drupal_fillpdf_fields
remove NOT NULL from field value

Real fix should be done in code/db config.

Comments

liam morland’s picture

Status: Active » Needs review
StatusFileSize
new950 bytes

Putr, there is no column "value" in the table "fillpdf_forms", so I think you have identified the wrong query as causing the problem. But I see an insert and an update query that could cause such an error. Please try the attached patch, which ensured that Fill PDF will store the empty string instead of null. Unfortunately, we have not yet switched to Postgres, so I can't do a full test.

wizonesolutions’s picture

Would like to see if this patch addressed Putr's issue or otherwise a patch that more conclusively solves this before committing. Leaving at needs review.

Putr’s picture

I'll test this tomorow on a vannilla install with postgres and report.

Putr’s picture

Status: Needs review » Reviewed & tested by the community

I've tested it on a vannilla install. The code also looks ok.

Liams patch fixes the problem.

thank you!

wizonesolutions’s picture

Version: 7.x-1.1 » 6.x-1.x-dev
Status: Reviewed & tested by the community » Patch (to be ported)

Fine by me. Committed to 7.x-1.x. Does this need backport to 6.x?

liam morland’s picture

Status: Patch (to be ported) » Needs review
StatusFileSize
new1.38 KB

Same code, but formatted differently is in D6. Patch attached. Not tested since I have no D6 nor Postgres. Apply after #1430390: Coding standards: remove whitespace.

wizonesolutions’s picture

Status: Needs review » Fixed

Committed in cdadc4c. Thanks!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

  • Commit 145ea7c on 7.x-1.x, 7.x-2.x, 7.x-2.x-tests1, 7.x-1.x-ubercartbackporttest authored by Liam Morland, committed by wizonesolutions:
    Issue #1356998: Store empty string instead of NULL.