# HG changeset patch # User jbe # Date 1452313845 -3600 # Node ID 015be25c98dd30c14098866c6517b9da326ccaeb # Parent a09a0defb48ad9600a221aea43e8a7e186d6c4f5 Always write to document when "document_column" is set in class diff -r a09a0defb48a -r 015be25c98dd libraries/mondelefant/mondelefant_native.c --- a/libraries/mondelefant/mondelefant_native.c Sat Jan 09 03:30:51 2016 +0100 +++ b/libraries/mondelefant/mondelefant_native.c Sat Jan 09 05:30:45 2016 +0100 @@ -1783,22 +1783,14 @@ // check proxy access to document in special column: lua_getfield(L, 4, "document_column"); // 6 if (lua_toboolean(L, 6)) { - lua_getfield(L, 1, "_column_info"); // 7 - if (!lua_isnil(L, 7)) { // TODO: quick fix to avoid problems on document creation - lua_pushvalue(L, 2); // 8 - lua_gettable(L, 7); // 8 - if (!lua_toboolean(L, 8)) { - lua_settop(L, 6); - lua_gettable(L, 5); // 6 - if (lua_isnil(L, 6)) { - return luaL_error(L, "Cannot write to document column: document is nil"); - } - lua_pushvalue(L, 2); // 7 - lua_pushvalue(L, 3); // 8 - lua_settable(L, 6); - return 0; + lua_gettable(L, 5); // 6 + if (lua_isnil(L, 6)) { + return luaL_error(L, "Cannot write to document column: document is nil"); } - } // TODO: quick fix to avoid problems on document creation + lua_pushvalue(L, 2); // 7 + lua_pushvalue(L, 3); // 8 + lua_settable(L, 6); + return 0; } lua_settop(L, 5); // store value in data field info: