table part of a field not found with calclated field in php
table part of a field not found with calclated field in php

From the JS, serverside is set to false. I am trying to add a caclulated column in the php editor code:
Field::inst( '( select 1 ) ' , 'editorform') ->set( false )
the above is giving me
DataTables warning: table id=Residents - Table part of the field "( select 1 ) " was not found. In Editor instances that use a join, all fields must have the database table set explicitly.
Answers
You are hitting this part of the code. Unfortunately it doesn't take account of doing something quite like you have. I'll need to have a think about that, possibly it could be as simple as checking for
(
and accepting that the dev knows what they are doing. That check is really just a sanity check and could be commented out in your local code if you want to bypass it.Allan
Ultimately, this is what I am trying to do and why. I have two different client-side editor forms that utilize the same php file named residents.php. In residents.php, when an edit / update is being posted, I call a sql Stored proc and pass $_POST which performs some behind-the-scenes edits. I want the stored proc to know which editor form the update originated from. I first tried to add a hidden field to the two editor definitions on the client side:
When I review the value of $_POST in residents.php, I have not been able to get a value to populate for field 'editorform':
$_POST= {"data":{"128":{"Residents":{"phone":"(111) 222-3333","email":"thisismyemail@gmail.com","residentnotes":"","AddressAID":"126"},"userAIDIsFamiliar":"1","Comments":"","UpdateFamiliars":"","view_Residents":{"FullNameParty":"COMMANDER, ANDREA S (BLK)"},"UserAID":"9","editorform":""}},"action":"edit"}
My thought was maybe because the field does not originate from the PHP, it won't accept any value (I was troubleshooting/trying stuff). So I was going to try to add a calculated field in the PHP and set a value on the client side, and evaluate.
Ah - you just want an extra field in the JSON response?
Should do it.
However, there shouldn't be any need to do that given your description. You should be able to have a field:
and it can be hidden or whatever, and not have a value in the original JSON.
If that isn't working for you, drop me a link to the page yo are working on and I'll take a look.
Allan