Slight issue with MySQL view

m6xmed5

Member
Hi guys, I had a fabrik list that was created from a MySQL view about a year ago.
I added a new column to the view yesterday using a query in phpmyadmin, but my fabrik list hasn't updated with the new column as an element.
I was wondering if anyone else has had this problem before or if anyone knows if there is a way to refresh the fabrik list?

I tried going into the list and saving it again but it didn't do the trick.
 
No, it won't automatically see it.

You'll have to create the element by hand. First, go to the List settings, Advanced tab, and set "Alter field types" to No, to prevent Fabrik from trying to modify the database. Then add an element, using the name of the field you added to the view.

-- hugh
 
So I get this message after changing the Alter Field Types to no...

Warning
You can't add fields to this list
This name is reserved for use by Fabrik, or is not a valid MySQL field name (must start with letter, then only letters, numbers or underscores)

I get the second warning that I can't add this element type because it has brackets in it, sum(tdkn18) but my original view had a column sum(tdkn) in it and it is in the list. Anyways changed it to a column name without brackets.
I don't know why I'm getting the first warning "You can't add fields to this list"

faberr.PNG
 
Last edited:
The warning is just that ... a warning ... you can't add fields. It's basically reminding you that you set "alter fields" to "No", so Fabrik won't make any modifications to the database. But you aren't actually adding a "field" (a database column), you are just adding an element in the Fabrik metadata.

-- hugh
 
It doesn't add the metadata, is there a way I can add it manually without using the gui? I assume it would be an entry on a different database table?

**Duh, in the fabrik elements table, ok so if I add it manually to the database it should work?
I don't want to break anything. Its pretty much a clone of another field on that table except it does a sum of a different dataset.
I have copied that other element then edited the name and the label to the new column in the view.
Ready to click Go but I have the fear!
 
Last edited:
@m6xmed5 - oops, I thought I'd fixed that a while ago. it should just warn you after you've saved, that no changes were made to the underlying tables/views, because it's a view.

@Sophist - yeah, I've been meaning to do that for a while, but it was fairly low down the priority list. But in fixing the issue that prevents you from adding elements to views, I went ahead and added the code to automatically set 'alter fields' to No for views.

https://github.com/Fabrik/fabrik/commit/84bee51f3d10b479077d925bf9160639bd131bac

That commit should fix things, so when you create a new list from a view, it'll automagically set 'alter fields' to No, but still allow you to create new elements (or change existing element names), to match changes you make by hand to the underlying view, and simply issue a notice that no changes were made to the database.

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top