Error when trying to create new table

Status
Not open for further replies.

BasilC

Member
Joomla4.2 PHP8.1 Fabrik4gamma1

Website running on localhost is an upgraded version of a production Joomla3 website.

This is the same website referred to in thread https://fabrikar.com/forums/index.php?posts/280547/. Because the form referred to in that thread has several validations that are only triggered under certain conditions, but none of them work and they're all difficult to describe, I thought I would create a new list and test some more straightforward conditional validations. However, I can't create the list (or more accurately, I can create the list, but can't get Fabrik to create the associated table).

Steps:
1. Navigate to Fabrik/Lists
2. Click on New
3. In the Label field type "Test2"
4. Click on Save
5. Leave content type as Default and click on Save and Close
Result:
An error has occurred: 0 Call to a member function xpath() on null
callstack2.png


The list is created, but has no fields and it's not possible to link it to a MySql table.
 
Just did a small test. It seems to be a difference , if you click in your step 4 (directly after you enter the label and not leaving the label field) 'save' or 'save and close'. I don't get an error in both cases, but if I only click save, no list is created, but a form with an empty table name.
 
How is your file
administrator\components\com_fabrik\models\content_types\default.xml
looking like?
 
I was looking for content types in the database, not in the files. This is what it looks like.

Code:
<?xml version="1.0"?>
<contenttype ignoreacl="true">
    <name>Default</name>
    <fabrikversion>4.0</fabrikversion>
    <group join_id="" is_join="0" id="118" name="{label}" label="{label}" css="" published="1"
           created="2016-01-10 08:53:39" private="0">
        <params repeat_group_button="0" repeat_group_show_first="1"/>

        <element label="id" published="1" name="id" id="662" plugin="internalid" created="2016-01-10 08:53:39" width="3"
                 height="0" default="" hidden="1" eval="0" ordering="2" show_in_list_summary="1" filter_type=""
                 filter_exact_match="" link_to_detail="1" primary_key="1" auto_increment="1" access="1"
                 use_in_page_title="0" parent_id="0">
            <params edit_access="1" view_access="1" list_view_access="1" filter_access="1" sum_access="1" avg_access="1"
                    median_access="1" count_access="1" custom_calc_access="1"/>
        </element>

        <element label="date_time" published="1" name="date_time" id="664" plugin="jdate" created="2016-01-10 08:53:39"
                 width="0" height="0" default="" hidden="1" eval="0" ordering="0" show_in_list_summary="1"
                 filter_type="" filter_exact_match="1" link_to_detail="1" primary_key="0" auto_increment="0" access="1"
                 use_in_page_title="0" parent_id="0">
            <params bootstrap_class="col-sm-6" jdate_showtime="1" jdate_time_format="H:i:s" jdate_time_24="1"
                    jdate_store_as_local="0" jdate_table_format="Y-m-d H:i:s" jdate_form_format="Y-m-d"
                    jdate_defaulttotoday="1" jdate_alwaystoday="0" jdate_allow_typing_in_field="1"
                    jdate_show_week_numbers="0" jdate_csv_offset_tz="0" show_in_rss_feed="0" show_label_in_rss_feed="0"
                    use_as_rss_enclosure="0" rollover="" tipseval="0" tiplocation="top-left" labelindetails="0"
                    labelinlist="0" comment="" edit_access="1" edit_access_user="" view_access="1" view_access_user=""
                    list_view_access="1" encrypt="0" store_in_db="1" default_on_copy="0" can_order="0"
                    alt_list_heading="" custom_link="" custom_link_target="" custom_link_indetails="1"
                    use_as_row_class="0" include_in_list_query="1" always_render="0" icon_folder="0" icon_hovertext="1"
                    icon_file="" icon_subdir="" filter_length="20" filter_access="1" full_words_only="0"
                    filter_required="0" filter_build_method="0" filter_groupby="text" inc_in_adv_search="1"
                    filter_class="col-sm-6" filter_responsive_class="" tablecss_header_class="" tablecss_header=""
                    tablecss_cell_class="" tablecss_cell="" sum_on="0" sum_label="Sum" sum_access="1" sum_split=""
                    avg_on="0" avg_label="Average" avg_access="1" avg_round="0" avg_split="" median_on="0"
                    median_label="Median" median_access="1" median_split="" count_on="0" count_label="Count"
                    count_condition="" count_access="1" count_split="" custom_calc_on="0" custom_calc_label="Custom"
                    custom_calc_query="" custom_calc_access="1" custom_calc_split="" custom_calc_php=""
                    validations="[]"/>
        </element>

    </group>
    <viewlevels>
        <viewlevel id="1" title="Public" ordering="0" rules="[1]"/>
        <viewlevel id="2" title="Registered" ordering="1" rules="[6,2,8]"/>
        <viewlevel id="3" title="Special" ordering="2" rules="[6,3,8]"/>
        <viewlevel id="5" title="Guest" ordering="0" rules="[9]"/>
    </viewlevels>
</contenttype>

I've never really got the hang of contents types. Are they something to do with migrating lists between databases or websites?
 
'save' or 'save and close'. I don't get an error in both cases, but if I only click save, no list is created, but a form with an empty table name.
Strange, I can't replicate. Are you sure you didn't start with creating a form?
 
@both:
I can't replicate.

Can you check:
Steps:
1. Navigate to Fabrik/Lists
2. Click on New
3. In the Label field type "Testxxx"
4. Click on Data : Is testxxx showing as 'Database table' automatically?
 
Testxxx shows on the form

fabrik new list.png


when I save it the content type form opens, but when I click on Save I get the error message as above. If I then return to the table of lists, the new list is there, but without a database

list view.png


But in elements table there is nothing for the new list

elements.png


Clicking on View Data I get an error message 500 Incorrect list id

an error has occurrred.png
 
I also have an older copy of the website migrated to Joomla 4 that has Fabrik4beta1. I've just created a new table there without any difficulty. Which doesn't prove that the version of Fabrik on that website has any bearing on this issue, it could be something else. I can test that by updating it to Fabrik4gamma1 then try creating another new table.
 
Going back to the website where I can't create a new table, I just came across this warning

one problem.png


I applied the fix but it hasn't helped with the new list issue.

Reinstalled Fabrik4gamma1 - still can't create a new list.
 
There's a bell ringing...
What is your database version?
Is it different to the database version on your "running" site?
 
Strange, I can't replicate. Are you sure you didn't start with creating a form?
I'm sure.
Basically I just wanted to test, if @BasilC 's problem was caused by not leaving the label field befor clicking save. It's very unlikely that this usually happens.

But the problem he/she has is obviously caused by something else.
 
@BasilC Some more questions:

Anything special with your Fabrik connection: is it pointing to the correct database (open, re-save)? Do you have multiple ones?

How are the rows in #_fabrik_lists looking for these "wrong" lists?
Did it create the form/group/elements? Check directly, not via list's "View Details". They may be there but not "linked" to the list.

Are the DB tables test1... created? If yes, which columns?

@wezetel : Do you have such Database warnings? Your database version? Is this behaviour replicatable? Is your site a F3 update?
 
@wezetel : Do you have such Database warnings? Your database version? Is this behaviour replicatable? Is your site a F3 update?
Hi @troester ,
no database warnings,
10.3.37-MariaDB-cll-lve,
yes, so this is a similiar 'don't do', like starting a list with creating a form. But it is unlikely that this (saving a new list, while the cursor is still in the label field) really happens to often.
Totally new J4/F3 site for testing...
 
Today I used an Akeeba backup made just before installing Fabrik3gamma to recreate the website as it was, using a different directory and new database. Exactly the same error message as before, I'm afraid.

The following answers to your questions are based on this.

@BasilC Some more questions:

Anything special with your Fabrik connection: is it pointing to the correct database (open, re-save)? Do you have multiple ones?

How are the rows in #_fabrik_lists looking for these "wrong" lists?
Did it create the form/group/elements? Check directly, not via list's "View Details". They may be there but not "linked" to the list.

Are the DB tables test1... created? If yes, which columns?

The Fabrik connection is definitely correct and it's the only database used by the website.

There is no table called test1 in the database.

This is the record for the Test1 Fabrik list in the database

fabrik list test1.png

Elements: No new elements created.

A new group Test1 was created.

group test1.png
group test1.png



form test1.png

Additionally, I tried selecting a different content group from the dropdown - "Contact us". Exactly the same error message after clicking on Save.

I guess my next move will be to start with a fresh backup from the J3 production database, convert it to J4 and hope that the issue doesn't recur, but I won't have the time to do that for some days.
 

Attachments

  • group test1.png
    group test1.png
    35.8 KB · Views: 49
There's a bell ringing...
What is your database version?
Is it different to the database version on your "running" site?

The development versions are using 10.4.24-MariaDB (XAMPP for Windows 8.1.6) and php8.1

The live website also uses MariaDB 10.3.38-MariaDB-1:10.3.38+maria~ubu2004 - mariadb.org binary distribution. It uses php8.0 - I've tried changing to 8.1 but clearly one or more of extension aren't compatible. Host is one.com.
 
Can you try with Gamma2?
We improved the error reporting, hopefully it now won't create an "incomplete" list but show some meaningful error message why it can't do it correctly.
 
Can you try with Gamma2?
We improved the error reporting, hopefully it now won't create an "incomplete" list but show some meaningful error message why it can't do it correctly.
I installed gamma2 but no joy - exactly the same error description as before (though preceded by the error caused by thumbs.php, which I got rid of by installing the new version.
 
I installed gamma2 but no joy
:mad:
It's clear what is happening: form and group are created but then the form id is not inserted into the fabrik_list entry.

So:
What is the structure of your fm3_fabrik_elements table (phpMyAdmin)?
 
:mad:
It's clear what is happening: form and group are created but then the form id is not inserted into the fabrik_list entry.

So:
What is the structure of your fm3_fabrik_elements table (phpMyAdmin)?

I've done screenshots of the structures for the elements table in the database with the issue (PGC2) and for an earlier version (PGC) where I can create tables without running into problems.

First PGC2

fabrik elements table pgc2 database.png


Now PGC

structure of fabrik elements table database pgc.png

The earlier version (PGC) has been around for several months but has a later creation date for the Fabrik tables because I went back to it and installed gamma2 a few days ago.

There are redundant lists and elements that I ought really to remove but I'm concerned that I might break something.
 
PGC2 doesn't match with the install or update #_fabrik_elements definition.
J! Database maintanance check won't check/repair all a of the update statements.

Assuming you have a test site:
Can you try
  • In the database #_schemas delete the row with version_it=4.0-2022-12-18
  • Then re-install gamma2 (+re-install thumbs-gamma2a if needed)
 
Status
Not open for further replies.
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top