Create a site
at the same time add http auth user/password
hit save
the next page is an error page

short term work around - create the site first, save and verify it. then add the http user/password, then save and verify

CommentFileSizeAuthor
#2 error_when_trying_to-2869215-2.patch650 byteshelmo

Comments

SocialNicheGuru created an issue. See original summary.

helmo’s picture

Status: Active » Needs review
StatusFileSize
new650 bytes

Hmm that would be Integrity constraint violation: 1048 Column 'whitelist' cannot be null: INSERT INTO {hosting_http_basic_auth} ...

The whitelist formfield is not shown on node creation due to the apache check on the server node :(
This patch should at least fix the error.

helmo’s picture

Status: Needs review » Reviewed & tested by the community

Seems to work well enough...

helmo’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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

dsnopek’s picture

This doesn't appear to have been committed. It also doesn't appear to fix the problem. :-) I tried using the latest Git and still saw this issue...

helmo’s picture

Sorry, it seems that I forgot to push ... done now.

sivaji_ganesh_jojodae’s picture

The patch seems to fix only a part of the problem. I could reproduce the same problem in another line, full error message is below,

WD node: PDOException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'whitelist' cannot be null: INSERT INTO {hosting_http_basic_auth} (vid, nid, username, password, message, whitelist) 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); Array ( [:db_insert_placeholder_0] => 14054 [:db_insert_placeholder_1] => 7383 [:db_insert_placeholder_2] => user [:db_insert_placeholder_3] => user [:db_insert_placeholder_4] => Restricted access [:db_insert_placeholder_5] => ) in hosting_http_basic_auth_update() (line 64 of /var/aegir/hostmaster-7.x-3.11.2/profiles/hostmaster/modules/aegir/hosting_tasks_extra/http_basic_auth/hosting_http_basic_auth.module).

Adding the same check to hosting_http_basic_auth_node_update() did fix the issue for me.

 function hosting_http_basic_auth_node_update($node) {
+  if ($node->type == 'site' && !empty($node->http_basic_auth_username)) {
+    if (!isset($node->http_basic_auth_whitelist)) {
+      $node->http_basic_auth_whitelist = '';
+    }
+ }
helmo’s picture

Thanks, added.

dsnopek’s picture

Thanks! I updated to the latest Git and didn't get this error anymore. :-)