douhuan1380 2011-09-30 12:37
浏览 44
已采纳

MVCTable中未定义的getUserId()函数

I use atk 4.1.2. I found a problem while I tried to Insert/Update my Model. It seems like because I added two fields in my table, i.e. : created_by and updated_by.

I found these lines caused the problem in MVCTable.php:

if (isset($this->fields['created_by']))
            $this->dsql('modify',false)->set('created_by',$this->api->getUserId());

if (isset($this->fields['updated_by']))
            $this->dsql('modify',false)->set('updated_by',$this->api->getUserId());

The method $this->api->getUserId() is not defined anywhere. I don't know whether this same problem occurs for the previous atk versions.

  • 写回答

1条回答 默认 最新

  • dongpu4141 2011-09-30 12:57
    关注

    Yes, it's a bit of legacy code which I haven't cleaned up yet. Please delete those lines manually and they will not be there in further versions.

    https://github.com/atk4/atk4-addons/commit/e3b2379

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?