• Hello Fabrik Community

    Fabrik is now in the hands of the development team that brought you Fabrik for Joomla 4. We have recently transitioned the Fabrik site over to a new server and are busy trying to clean it up. We have upgraded the site to Joomla 4 and are running the latest version of Fabrik 4. We have also upgraded the Xenforo forum software to the latest version. Many of the widgets you might have been used to on the forum are no longer operational, many abandoned by the developers. We hope to bring back some of the important ones as we have time.

    Exciting times to be sure.

    The Fabrik 4.0 Official release is now available. In addition, the Fabrik codebase is now available in a public repository. See the notices about these in the announcements section

    We wish to shout out a very big Thank You to all of you who have made donations. They have really helped. But we can always use more...wink..wink..

    Also a big Thank You to those of you who have been assisting others in the forum. This takes a very big burden off of us as we work on bugs, the website and the future of Fabrik.

k is null

Status
Not open for further replies.

susannanam

Member
hi all,

i have a list with a php plugin. the various field-values ($id_user and $student) i pull are correct and so is the sql statement as it correctly inserts if tested the output of the var_dump directly in mysql. i have also deactivated the delete statement before... but nothing helps. if i run the php, it gives me the error "k is null". when activating debug = js, then it says "json is null". and it keeps telling me the following:"SyntaxError: missing ) in parenthetical"

Here is the code of my plugin:
Code:
$app = JFactory::getApplication();
$ids = $app->input->get('ids', array(), 'array');
$user = JFactory::getUser();
$id_user = $user->get('id');
 
//$item = $model->getTable();
//echo "<pre>";print_r($item);exit;
 
//empty statement table from previous statements by that user
$sql = "delete FROM sh2m8_student_statement
  WHERE user_id = $id_user;";
//var_dump($sql); exit;
$db->setQuery( $sql );
$db->execute();
   
foreach ($ids AS $myid)
{
    $row = $model->getRow($myid);
    $student = $row->sh2m8_student___student_id;
    //$element_raw = $row->your-full-elementname_raw;
    //var_dump($student); exit;
   
    $sql = "insert into sh2m8_student_statement
      (tx_date,term_id,type,student_id,debit,
      credit,description,reference,update_by,update_timestamp,
      audit_no,ccm,user_id)
      select tx_date,term_id,type,student_id,debit,
      credit,description,reference,update_by,update_timestamp,
        audit_no,ccm,$id_user
        FROM sh2m8_student_accounts WHERE student_id = '$student';";
    //var_dump($sql); exit;
    $db->setQuery( $sql );
    $db->execute();
    //echo "<pre>";print_r($row);
}
//exit;

does anyone have an idea what can the problem be????????

thanks
susanne
 
This seems to be a JS error message which may be caused by an error message in the Network Response (instead of the expected JSON).
Is your list ajaxfied (list/navigation)?
Try to set it to no to see the error message directly.

Or examine the Network Response with a browser dev tool.
 
This seems to be a JS error message which may be caused by an error message in the Network Response (instead of the expected JSON).
Is your list ajaxfied (list/navigation)?
Try to set it to no to see the error message directly.

Or examine the Network Response with a browser dev tool.
hi troester,
thanks for the quick answer. no the list is not ajaxfied. i did now set it to no (the debug) but the error message remains the same, "k is null".

you say i shall examine the network response, what exactly must i do? i use firefox.
 
I'm working with the firebug addon but I think meanwhile Firefox has a build-in dev tool:
right-click somewhere in your list, select "Element untersuchen" (Inspect element)
click on Netzwerkanalyse
reload the page
click on (usually) the first entry (Typ html)
click on "Antwort" (Response) tab (right side)
 
I'm working with the firebug addon but I think meanwhile Firefox has a build-in dev tool:
right-click somewhere in your list, select "Element untersuchen" (Inspect element)
click on Netzwerkanalyse
reload the page
click on (usually) the first entry (Typ html)
click on "Antwort" (Response) tab (right side)

hm i am busy trying, the php plugin is a button, must i now inspect this button? then reload? and then press the button? sorry, not sure about how i can get the result... tried a few things but dont seem to get it right :(
 
due to the very first line of the app, i totally forgot to initialize the db with $db = JFactory::getDbo();... troester had a look and now it works fine :) thanks!
 
Status
Not open for further replies.
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top