Hard coded database file in J2Store plugin

CyW

New Member
We have tried to use the J2Store plugin as it is ideal for our website. After the J2Store form is generated we get a large Error500 message when we try to view the data.

Studying the error message we have discovered that a query is performed to a non existent database file. The wrong prefix is used: "zwkgr". Trying the procedure on a different web site with a different database file prefix, shows that the same wrong prefix is used.

Changing the prefix to "zwkgr" in the database (during a restore with Akeeba) solves the error. This prefix seems to be hardcoded in producst.xml

My questions are:

1) Does anyone else have this problem
2) Can the absolute prefix be changed to a relative one please?

Paul Vos, CYW
 
I don't have that issue, and I can't find any occurrences of that prefix in the code.

Can you copy and paste the query here.

-- hugh
 
Ah, I see the problem. It's in the product.xml for the canned content type, ie. when you create a new list and select that as a predefined content type.

I'll take a look, see if I can resolve that.

-- hugh
 
Ah, I see. It was fixed in the copy in github, but I'd run the plugin install prior to that, which copies that file to the main backend models/content_types folder, so my actual woring copy still had the broken names.

Also, I'm not convinced the content type importer correctly handles #__ in the table names.

-- hugh
 
Also, I'm not convinced the content type importer correctly handles #__ in the table names.
This seems to be ok.
I just installed j2store form plugin (from GitHub with the corrected products.xml).
Creating a list with this content type is creating correctly myprefix_j2store_... tables

Although I got a warning like "content type from Fabrik3.4" while creating the list
and
Notice: Undefined property: FabrikTableJoin::$table_join_alias in C:\xampp54\htdocs\j35\plugins\fabrik_element\databasejoin\databasejoin.php on line 309

on list's "view data"
 
Yeah, I've got a feeling the import needs to convert the #__ prefix to the actual prefix before it creates the element. I'm pretty sure there's going to be hidden gotchas if the param for join_table_name uses the #__ for the prefix.

I haven't looked, but I'm willing to bet that warning you are seeing is because we're failing to match #__j2store_foo against abc_j2store_foo.

-- hugh
 
Last edited:
We do have it working now. In version 3.5.1. the product.xml file is fine (btw. the filename is "producst.xml"). However, there was more work to do than just changing this file. There are two Fabrik tables that still contain the 'zwkgr' prefix: ..._fabrik_elements and ..._fabrik_joins. We changed the 'zwkgr' prefix in the appropriate prefix and this problem is solved.

Paul Vos, CYW
 
The next problem is to get the "add to chart" button. Somehow we do not get it visible in version 3.5.1. We noticed the list reserves some space for it, but we can't get it working.
Any suggestions?

Paul Vos, CYW
 
I did have contact with J2Store when I was running Fabrik version 3.5.0. They changed a file for me to get it running. I made the same changes in version 3.5.1. but it did not work for me. I can give you access to my site if you need it and I also can give you the changes J2Store made.
Just let me know.


Paul Vos, CYW
 
Did you try with Protostar?
There may be icons missing etc.
You can override the "add to cart" layouts in plugins\fabrik_form\j2store\layouts
 
This is the code I got:

/public_html/plugins/fabrik_form/j2store/j2store.php
line number 98

if (empty($data['product_type']))
{
$data['product_type'] = 'simple';
}

line number 128,

$data['product_id'] = $productId;
$data['is_master'] = 1;
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top