DataTables warning AJAX error

39 views
Skip to first unread message

Shawn Yeh

unread,
Nov 7, 2025, 3:27:55 PM11/7/25
to jorani
Hi Benjami,
I just migrate our Jorani to a new host and got this error when I click on the "list of employee", other lists are seem to be working fine.

The error message is below, please guide me how to fix this issue.
"DataTables warning: table id=users - Ajax error. For more information about this error, please see http://datatables.net/tn/7"

Thank you for the help and the created this great software.

Shawn Yeh

unread,
Nov 12, 2025, 11:05:38 PM11/12/25
to jorani
Hi Benjami,

I solved the problem myself.
The issue goes with database import error/skip, so database routines was missing.
The AJAX error started from "GetFamilyTree" missing.
I copied "GetFamilyTree" routines from old sql file and execute it on new one to create same routine and everything working now.

DELIMITER ;;
CREATE FUNCTION `GetFamilyTree`(`GivenID` INT) RETURNS varchar(1024) CHARSET utf8
    READS SQL DATA
    SQL SECURITY INVOKER
BEGIN
    DECLARE rv,q,queue,queue_children VARCHAR(1024);
    DECLARE queue_length,front_id,pos INT;

    SET rv = '';
    SET queue = GivenID;
    SET queue_length = 1;

    WHILE queue_length > 0 DO
        IF queue_length = 1 THEN
            SET front_id = CAST(queue AS DECIMAL);
            SET queue = '';
        ELSE
            SET pos = LOCATE(',',queue);
            SET front_id = CAST(SUBSTR(queue, 1, pos-1) AS DECIMAL);
            SET q = SUBSTR(queue,pos + 1);
            SET queue = q;
        END IF;
        SET queue_length = queue_length - 1;

        SELECT IFNULL(qc,'') INTO queue_children
        FROM (SELECT GROUP_CONCAT(id) qc
        FROM organization WHERE parent_id = front_id) A;

        IF LENGTH(queue_children) = 0 THEN
            IF LENGTH(queue) = 0 THEN
                SET queue_length = 0;
            END IF;
        ELSE
            IF LENGTH(rv) = 0 THEN
                SET rv = queue_children;
            ELSE
                SET rv = CONCAT(rv,',',queue_children);
            END IF;
            IF LENGTH(queue) = 0 THEN
                SET queue = queue_children;
            ELSE
                SET queue = CONCAT(queue,',',queue_children);
            END IF;
            SET queue_length = LENGTH(queue) - LENGTH(REPLACE(queue,',','')) + 1;
        END IF;
    END WHILE;
    RETURN rv;
END;;
DELIMITER ;

Thank you anyway.
I provide details in case someone else needs.

José Pedro Campos Pérez

unread,
Nov 15, 2025, 6:16:12 AM11/15/25
to jor...@googlegroups.com
?

--
You received this message because you are subscribed to the Google Groups "jorani" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jorani+un...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/jorani/af23a2d8-4e76-44c2-95e1-d50ed89f29c0n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages