Hi,

This bug can easily reproduced by by adding the following line to 'standard.install'

dependencies[] = maestro_technical_support_request_workflow

And starting a default installation.

Bug Description:

I want to use an exported maestro work in a module which is installed by an installation profile.

There are two bugs:

1) the function maestro_createTemplateVariable does not exist at this time
You can fix this by adding the following snippet to the beginning of your install hook:

$path = drupal_get_path('module','Maestro');
require_once($path . '/maestro.admin.inc');

2) maestro_createTemplateVariable does user validation:

if(!user_access('maestro admin')) return false;

As there are no users during the installation process the validation fails and causes the Drupal installation to fail.

Starting Drupal installation. This takes a few seconds ...                                                                                     [ok]
WD php: PDOException: SQLSTATE[HY000]: General error: 1366 Incorrect integer value: '' for column 'assign_id' at row 1: INSERT INTO            [error]
{maestro_template_assignment} (template_data_id, assign_type, assign_by, assign_id) VALUES (:a1, :b1, :c1, :d1); Array
(
    [a1] => 3
    [b1] => 1
    [c1] => 2
    [d1] => 
)
 in maestro_technical_support_request_workflow_install() (line 420 of
/htdocs/sites/all/modules/contrib/maestro/modules/maestro_technical_support_request_workflow/maestro_technical_support_request_workflow.install).
WD php: Warning: Cannot modify header information - headers already sent by (output started at                                                 [warning]
/drush/includes/drush.inc:868) in drupal_send_headers() (line 1040 of /htdocs/includes/bootstrap.inc).
PDOException: SQLSTATE[HY000]: General error: 1366 Incorrect integer value: '' for column 'assign_id' at row 1: INSERT INTO {maestro_template_assignment} (template_data_id, assign_type, assign_by, assign_id) VALUES (:a1, :b1, :c1, :d1); Array
(
    [a1] => 3
    [b1] => 1
    [c1] => 2
    [d1] => 
)
 in maestro_technical_support_request_workflow_install() (line 420 of /htdocs/sites/all/modules/contrib/maestro/modules/maestro_technical_support_request_workflow/maestro_technical_support_request_workflow.install).
Drush command terminated abnormally due to an unrecoverable error.                                                                             [error]

Comments

_randy’s picture

The latest rev of the technical support request flow has the include in the install hook.

Now for the profile install for the technical support flow:
In my development environment, I do have a fix for the user_access check.
However there is another issue where the actual technical support workflow is not installed. Maestro gets installed just fine, but the technical support request flow is not.

so there is something else that's not quite right. Will have to dig further into this one.

jantimon’s picture

Thanks for your work randy!

Refineo’s picture

I had almost the same issue with the current maestro_technical_support_request_workflow 7.x-1.x-dev version during the module install time.
The only difference is "line 425" instead of "line 420", please see code below:

PDOException: SQLSTATE[HY000]: General error: 1366 Incorrect integer value: '' for column 'assign_id' at row 1: INSERT INTO {maestro_template_assignment} (template_data_id, assign_type, assign_by, assign_id) VALUES (:a1, :b1, :c1, :d1); Array ( [a1] => 3 [b1] => 1 [c1] => 2 [d1] => ) in maestro_technical_support_request_workflow_install() (line 425 of /***/sites/all/modules/maestro/modules/maestro_technical_support_request_workflow/maestro_technical_support_request_workflow.install).
cigotete’s picture

Hello. I am having the same issue (I am using Maestro 7.x-1.5). I want to create a template when a module is installed (using the hook_install) and the error messages described by @refineo and @jantimon appears:

PDOException: SQLSTATE[HY000]: General error: 1366 Incorrect integer value: ''  [error]
for column 'assign_id' at row 1: INSERT INTO {maestro_template_assignment} (template_data_id,
assign_type, assign_by, assign_id) VALUES (:a1, :b1, :c1, :d1); Array
(
    [a1] => 142
    [b1] => 1
    [c1] => 2
    [d1] => 
)...

In my case, I am working with a custom template, that does not have relation with the module maestro_technical_support_request_workflow (or the respective template).

Any progress/ideas about why is happening the issue and how can be fixed the issue?

cigotete’s picture

I want to add to the previous comment that the same error appears if is installed the maestro_test_flows module or maestro_technical_support_request_workflow module, and the respective templates are not builded in the targeted site.

_randy’s picture

Can you try the dev release to see if that fixes the issue?

_randy’s picture

Status: Active » Postponed (maintainer needs more info)
cigotete’s picture

Hi. I have prepared a fresh installation of a Drupal 7.38 with the dev version of Maestro for to test the scenario without any other module different than required, and i found that the error appears even with a fresh Drupal with the dev version of Maestro:

these were the commands after install the Drupal 7.38:

drush dl maestro-7.x-1.x-dev
drush en maestro, maestro_common, maestro_content_publish, maestro_test_flows -y

and after that the error appears:

exception 'PDOException' with message 'SQLSTATE[HY000]: General error: 1366 Incorrect integer value: '' for column 'assign_id' at row 1' in ..drupal-7.38/includes/database/database.inc:2171

I have disabled and uninstalled the modules and installed again without the maestro_test_flows module and the enable process was executed ok without problems.

drush en maestro, maestro_common, maestro_content_publish -y

maybe the issue could be related with the maestro_test_flows module? .. anyway if I try to import the templates (using a hook_install) the templates can not be imported and the error appears.

_randy’s picture

Odd -- I just did a fresh (as in from scratch and even done manually) install of Drupal and layered the requirements on manually and I've been able to install Maestro and all sub-modules just fine -- including the technical support flow. I've been able to do imports/exports and help clients with Maestro workflows in the same manner.

cigotete’s picture

Thanks @_randy for your review and your help. Then I understand that the issue can be in the environment (or maybe the layer 8 :-) ).