• Resolved Dean

    (@deanbolton)


    I have an issue where new entries added via the CLI are not actually added to the form. This is the case for both the entry ‘import’ and ‘create’ commands.

    I have run this on a fresh install with no other plugins to rule out conflicts with other plugins, etc.

    I am following the examples documented here: https://www.stevenhenty.com/gravity-forms-cli/

    The form:

    wp gf form list
    +----+--------------+---------------------+-----------+-------------+------------+
    | id | title        | date_created        | is_active | entry_count | view_count |
    +----+--------------+---------------------+-----------+-------------+------------+
    | 1  | Support Form | 2017-05-30 05:28:29 | 1         | 0           | 0          |
    +----+--------------+---------------------+-----------+-------------+------------+
    

    The form fields:

    wp gf field list 1
    +----+------+-------+
    | id | type | label |
    +----+------+-------+
    | 1  | text | ID    |
    | 2  | text | Name  |
    +----+------+-------+
    

    The ‘entry create’ command:

    wp gf entry create 1 --ID=1 --Name=Test --debug
    Debug (bootstrap): No readable global config found (0.018s)
    Debug (bootstrap): No project config found (0.02s)
    Debug (bootstrap): No package autoload found to load. (0.291s)
    Debug (bootstrap): ABSPATH defined: /Applications/MAMP/htdocs/localhost/wordpress/ (0.291s)
    Debug (bootstrap): Begin WordPress load (0.292s)
    Debug (bootstrap): wp-config.php path: /Applications/MAMP/htdocs/localhost/wordpress/wp-config.php (0.292s)
    Debug (bootstrap): Loaded WordPress (0.948s)
    Debug (bootstrap): Running command: gf entry create (0.948s)
    <strong>Success: Entry created successfully. Entry ID: 1</strong>
    

    The result:

    wp gf entry list 1
    +----------+-------+---------+
    | Entry Id | 1: ID | 2: Name |
    +----------+-------+---------+
    +----------+-------+---------+
    

    The database shows an entry in the wp_rg_lead table, but nothing in the wp_rg_lead_detail table.

    wp_rg_lead:

    # id, form_id, post_id, date_created, is_starred, is_read, ip, source_url, user_agent, currency, payment_status, payment_date, payment_amount, payment_method, transaction_id, is_fulfilled, created_by, transaction_type, status
    '1', '1', NULL, '2017-05-30 05:30:44', '0', '0', '127.0.0.1', 'https://localhost/wordpress', 'API', 'USD', NULL, NULL, NULL, '', NULL, NULL, NULL, NULL, 'active'

    wp_rg_lead_detail:

    # id, lead_id, form_id, field_number, value
    [empty]

    The ‘entries’ count indicate that the entry has been successfully added, however, the entries list does not show anything.

    Are you able to assist? Am I doing something wrong?

    Thanks, Dean.

Viewing 1 replies (of 1 total)
  • Thread Starter Dean

    (@deanbolton)

    Ok – the create statement was wrong. Should be:

    wp gf entry create 1 --field_1=1 --field_2=Test --debug

    You must use field IDs and not names/labels.

Viewing 1 replies (of 1 total)
  • The topic ‘New entries not saving/showing in form’ is closed to new replies.