Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7041417
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T02:02:35+00:00 2026-05-28T02:02:35+00:00

I need help in ATK4 CRUD. I have built a backend for a project

  • 0

I need help in ATK4 CRUD. I have built a backend for a project using Agile Toolkit 4.1.3.
I have the following Model:

class Model_Product extends Model_Table
{
public $entity_code = 'product';

function init()
{
    parent::init();

    $this->addField('category_id')->refModel('Model_Category')->mandatory(true);
    $this->addField('name')->mandatory(true);
    $this->addField('picture_id')->refModel('Model_Picture')->mandatory(true);
    $this->addField('short_description')->mandatory(true);
    $this->addField('description')->type('text')->mandatory(true);
    $this->addField('uploaded_at')->type('datetime');
    $this->addField('price')->type('int')->mandatory(true);
    $this->addField('quantity')->type('int')->mandatory(true);
    $this->addField('status')->datatype('list')
            ->listData(array(
                        'enabled'=>'Enabled',
                        'disabled'=>'Disabled',
                        ))
            ->defaultValue('enabled');
}
}

the page:

<?php
class page_index extends Page {
function init(){
    parent::init();
    $page=$this;

    $tabs = $page->add('Tabs');
    $tabs->addTab('Product')->add('CRUD')->setModel('Product');
....

On my localhost all CRUD functions work flawlessly, but after I uploaded the files to the webserver when I try to add a new product I get this error:

`Error in AJAX response: SyntaxError: invalid XML attribute value
SQLException

Could not execute query: insert into product (category_id, name, picture_id, short_description, description, uploaded_at, price, quantity, status) values (NULL, ‘as’, NULL, ”, ”, NULL, 2500, 25, ‘enabled’)
Last query:
insert into product (category_id, name, picture_id, short_description, description, uploaded_at, price, quantity, status) values (NULL, ‘as’, NULL, ”, ”, NULL, 2500, 25, ‘enabled’)
MySQL error:
Column ‘category_id’ cannot be null`

Strange thing that the missing values in the query are visible in the crud form but never make it to the query. Additional info: in Model_Picture I use varchar id field instead of autoincrement int but once again everything works fine on localhost.

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T02:02:36+00:00Added an answer on May 28, 2026 at 2:02 am

    I had all my crud functions on one page on tabs like this:

    <?php
    class page_index extends Page {
    function init(){
        parent::init();
        $page=$this;
    
        $tabs = $page->add('Tabs');
        $tabs->addTab('Product')->add('CRUD')->setModel('Product');
        $tabs->addTab('Category')->add('CRUD')->setModel('Category');
        $tabs->addTab('Property')->add('CRUD')->setModel('Property');
        $tabs->addTab('Property <> Product')->add('CRUD')->setModel('ProductProperty');
        $tabs->addTab('Payment options')->add('CRUD')->setModel('Payment');
        $tabs->addTab('Shipping options')->add('CRUD')->setModel('Shipping');
        $tabs->addTab('Users')->add('CRUD')->setModel('User');
        $tabs->addTab('Email addresses')->add('CRUD')->setModel('Email');
        $tabs->addTab('News')->add('CRUD')->setModel('News');
        $tabs->addTab('Downloads')->add('CRUD')->setModel('Download');
        $tabs->addTab('Designer Aids')->add('CRUD')->setModel('Aid');
    
    }
    }
    

    Then I created a new page for every Model and added only one CRUD on each page and it solved the problem, now it works fine both on localhost and the server.

    Thank you guys for all your help.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Need help using regex and powershell to accomplish the following. I have the following
Need help... I have 3 classes, Manager which holds 2 pointers. One to class
Need help with implementing a pure abstract class via inheritance , using namespace to
need help in some wired problem. I have a sqlite table items as following
need help on Regex. Say I have the following text: * 1 FETCH (UID
Need help writing a script downloads data from google insight using c# this is
I need help on this following aspx code aspx Code: <asp:Label ID =lblName runat
I need help understanding some C++ operator overload statements. The class is declared like
i need help with disk_total_space function.. i have this on my code <?php $sql=select
Need help. I have Graph API code that uses an auth token with offline

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.