castlamp / zenbership

(2015) Zenbership Membership Software: Achieve Membership Nirvana
Other
112 stars 58 forks source link

Saved forms are not displaying in Admin > Integration > Forms #18

Open greatjscott opened 7 years ago

greatjscott commented 7 years ago

I have been setting up some registration forms in the Admin > Integration > Forms area. I have used both Paid and Free type registration forms as well as a custom form. All are set to public etc as suggested in the Doco. I am able to build the forms and save them (they entries are in the DB) however when I go back into the Admin menu and try to retrieve them - no forms are listed. I have changed Filter options to specifically retrieve known forms but still nothing is retrieved. The registration form as designed appears from the login page. Has anyone experienced this and knows how to get the forms to list so they can be edited?

jbelelieu commented 7 years ago

You can try running this command within your MySQL database:

UPDATEppSD_formsSETact_id= '' WHEREact_idIS NULL;

hibijibi commented 7 years ago

I'm having a similar issue. I'm able to add items and new items appear on the shop store. However when trying to view products from the admin panel nothing is returned. I attempted using

UPDATE ppSD_products SET act_id= '' WHERE act_id IS NULL;

But the column name doesn't exist in products. Should it be applied to another? Any thoughts?

hibijibi commented 7 years ago

I tried the string below with no success.

UPDATE ppSD_products SET hide_in_admin = '' WHERE hide_in_admin IS NULL;

hibijibi commented 7 years ago

UPDATE ppSD_products SET hide = NULL WHERE hide = '';

Tried this as well, no luck. I'll stop spamming and wait for response.

alexhuang888 commented 7 years ago

I experienced the same issue, tried to mess up codes, maybe you can try this for now:

find the file admin/cp-classes/admin.class.php

update these lines (starts around line 1225)

function build_filter_query($filters, $table, $eq = ' AND ')
{
    $add_query = '';
    if (is_string($filters)) {
        $filters = unserialize($filters);
    }
    if (!empty($filters)) {
        foreach ($filters as $aFilter) {
            if (! empty($aFilter)) {
                if (is_array($aFilter)) {
                    $add_query .= ' ' . $eq . ' (';
                    $add_query .= substr($this->build_filter_query($aFilter, $table, ' OR '), 4);
                    $add_query .= ' )';
                } else {
                    $break = explode('||', $aFilter);
                    if (!empty($break['0'])) {
                        if ($break['0'] == '-') {
                            $break['0'] = '';
                        } elseif ($break['0'] == '--') {
                            $break['0'] = '0';
                        }
                        if (empty($break['3'])) {
                            $break['3'] = $table;
                        }
                        //$add_query .= " $eq " . "(" . $break['3'] . "." . $break['1'];
                        $add_query .= " $eq " . "( IFNULL(" . $break['3'] . "." . $break['1'] . ", '')";
                        if ($break['2'] == 'like') {
                            $add_query .= " LIKE '%" . $this->mysql_cleans($break['0']) . "%'";
                        } else if ($break['2'] == 'like_start') {
                            // For alpha sorting options
                            if ($break['0'] == '0-9') {
                                $add_query .= " NOT REGEXP '^[[:alpha:]]'";
                            } else {
                                $add_query .= " LIKE '" . $this->mysql_cleans($break['0']) . "%'";
                            }
                        } else if ($break['2'] == 'gt') {
                            $add_query .= ">'" . $this->mysql_cleans($break['0']) . "'";
                        } else if ($break['2'] == 'lt') {
                            $add_query .= "<'" . $this->mysql_cleans($break['0']) . "'";
                        } else if ($break['2'] == 'gte') {
                            $add_query .= ">='" . $this->mysql_cleans($break['0']) . "'";
                        } else if ($break['2'] == 'lte') {
                            $add_query .= "<='" . $this->mysql_cleans($break['0']) . "'";
                        } else if ($break['2'] == 'noteq' || $break['2'] == 'neq') {
                            $add_query .= "!='" . $this->mysql_cleans($break['0']) . "'";
                        } else {
                            $add_query .= "='" . $this->mysql_cleans($break['0']) . "'";
                            if ($break['0'] == '')
                            {
                                $add_query .= " OR IFNULL(" . $break['3'] . "." . $break['1'];
                                $add_query .= ", '') IS NULL";
                            }
                        }
                        $add_query .= ")";
                    }
                }
            }
        }
    }
    return $add_query;
}

there might be some logic needs to be updated, just a work-around for me to continue my test.

hibijibi commented 7 years ago

This worked for me. Seems similar to the original issue posted. Thank you for you help.

greatjscott commented 7 years ago

hibijibi - sounds like the install process may not have successfully completed. There is a known error of the install process that (a) the DB create process fails and (b) the insert statement process fails. Using your DB Manager (phpAdmin or the like) check the list of tables against the doco. Check that the table _ppSDforms has columns defined as follows : id criteria _actid name description code_required date owner public reg_status pages member_type preview step1_name step2_name step3_name step4_name step5_name
public_list static disabled account_create terms_id captcha redirect account source email_thankyou template email_forward .

Check for the table _ppSD_widgetsmenus and that columns and values in the columns exist. Re-post with the results of the checks above.

alexhuang888 thanks for the code - I haven't run it yet but you're right, the function that updates the *_ppSDforms needs to set a "blank": value to act_id as opposed to a NULL value for the forms to be visible in the windows. Without that happening - everytime you edit a form you will then need to run the command from jbelelieu (Post#2) within your MySQL database: UPDATE ppSD_forms SET act_id= ' ' WHERE act_id IS NULL;

Florencia007 commented 7 years ago

I also have "type" for ppSD_forms, in which order goes that one?

greatjscott commented 7 years ago

"type" should appear after id and before criteria

type is defined as _enum('admin_cp','payment_form','register-free','contact','updateaccount','event','register-paid','campaign','dependency','update') NOT NULL,