Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

#238 breaks m_config:set_value/4 #244

Closed
kaos opened this Issue · 3 comments

3 participants

Andreas Stenius Arjan Scherpenisse Marc Worrell
Andreas Stenius
Owner
=SUPERVISOR REPORT==== 27-Oct-2011::16:41:05 ===
     Supervisor: {,z_site_sup}
     Context:    start_error
     Reason:     {'EXIT',{{case_clause,[]},
                          [{m_config,set_value,4},
                           {z_site_startup,start_link,1},
                           {supervisor,do_start_child,2},
                           {supervisor,start_children,3},
                           {supervisor,init_children,2},
                           {gen_server,init_it,6},
                           {proc_lib,init_p_do_apply,3}]}}
     Offender:   [{pid,undefined},
                  {name,z_site_startup},
                  {mfargs,
                      {z_site_startup,start_link,
                          [[{enabled,true},
                            {host,maberlz},
                            {hostname,"xxxx"},
                            {dbdatabase,"zotonic"},
                            {dbschema,"public"},
                            {admin_password,"xxxx"}]]}},
                  {restart_type,permanent},
                  {shutdown,5000},
                  {child_type,worker}]

The case only expects a 0 or 1:

case z_db:q("update config set value = $1, modified = now() where module = $2 and key = $3", [Value, Module, Key], Context) of
    0 -> z_db:insert(config, [{module,Module}, {key, Key}, {value, Value}], Context);
    1 -> ok
end,

but 0 is now always translated to []... so this could creep up in a lot of places, right?

I suggest improving the solution of issue #238.

Arjan Scherpenisse
Owner

I agree. I really like that the update statement returns the nr. of rows affected...

Marc Worrell
Owner

I too.

Rollback of the last change and think of something new?

Any takers?

Arjan Scherpenisse
Owner

Rolled back. See #247

Arjan Scherpenisse arjan closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.