Joomla Field Tags error frontend #604

Closed
opened 2020-09-23 14:27:33 +00:00 by studio16 · 4 comments
studio16 commented 2020-09-23 14:27:33 +00:00 (Migrated from github.com)

Joomla Tag field type is added to the getListQuery model but there is no db column added to the db table.
this of course gives a Unknown column 'a.tags' in 'field list'
i see 2 options

  1. the tag field is kept out of the model
  2. when tag type field is used add the column to the table just to get rid of the error

problem with option 1 is u can never use a field and name it tag, therefor i would go for option2 and add a table column (which remains empty)

Joomla Tag field type is added to the getListQuery model but there is no db column added to the db table. this of course gives a Unknown column 'a.tags' in 'field list' i see 2 options 1. the tag field is kept out of the model 2. when tag type field is used add the column to the table just to get rid of the error problem with option 1 is u can never use a field and name it tag, therefor i would go for option2 and add a table column (which remains empty)

The dynamic get area gives you the ability to get the table, instead of the view values. Using the table does not return the tags column. yet if you use the view option, just remove the tags column, or use the select all option if it is the main table.

The values are stored in the #__contentitem_tag_map table, and should you need the actual tag values, you should use the join options to get those tags, something like this:
image

So to me the option to add the tags to the tag table is really not good, it will complicate the model, since we actually do need the tags field to store it correctly into the #__contentitem_tag_map table. Best just remove the field from the table query when you setup the dynamicGet in the first place (manually).

I am closing this, but if you still think more consideration is required just bump this issue, and I will reopen it if needed.

The dynamic get area gives you the ability to get the table, instead of the view values. Using the table does not return the tags column. yet if you use the view option, just remove the tags column, or use the select all option if it is the main table. The values are stored in the [#__contentitem_tag_map](https://github.com/joomla/joomla-cms/blob/3.9.22/installation/sql/mysql/joomla.sql#L436) table, and should you need the actual tag values, you should use the join options to get those tags, something like this: ![image](https://user-images.githubusercontent.com/5607939/95266580-c700ba00-0833-11eb-9c4f-ccb422cba9b5.png) So to me the option to add the tags to the tag table is really not good, it will complicate the model, since we actually do need the tags field to store it correctly into the [#__contentitem_tag_map](https://github.com/joomla/joomla-cms/blob/3.9.22/installation/sql/mysql/joomla.sql#L436) table. Best just remove the field from the table query when you setup the dynamicGet in the first place (manually). I am closing this, but if you still think more consideration is required just bump this issue, and I will reopen it if needed.
studio16 commented 2020-10-07 07:38:45 +00:00 (Migrated from github.com)

this is not about getting the tags values, this about using a field of type "tag" giving an error cause the column is not created by jcb. Just adding that column in that table is all that has to be done to get rid of that error. We don't need to set any values to it, it just have to exist since the model assumes it's there, which is giving the error.

this is not about getting the tags values, this about using a field of type "tag" giving an error cause the column is not created by jcb. Just adding that column in that table is all that has to be done to get rid of that error. We don't need to set any values to it, it just have to exist since the model assumes it's there, which is giving the error.

The front-end model will only look for this if you leave the tags value in the query, if you remove it like so:
image

TO:

image

OR:

image
You should not have any issue.

The main reason the GUI adds the tags field/column is because of how it builds the fields in the first place, it does not know head of time if a field is added to the database, or not. But hey, the code that builds the SQL query values in the GUI are over here, and you are most welcome to go over that and make a pull request if you feel you have found a better implementation.

But I am not going to force the tags field to be added to the table, as this will be a bad implementation and cause all sorts of pain.

The front-end model will only look for this if you leave the tags value in the query, if you remove it like so: ![image](https://user-images.githubusercontent.com/5607939/95397991-f9c6b300-0904-11eb-944c-583cc270ebf3.png) # TO: ![image](https://user-images.githubusercontent.com/5607939/95398010-03e8b180-0905-11eb-8283-7094a922fe8a.png) # OR: ![image](https://user-images.githubusercontent.com/5607939/95398025-0ea34680-0905-11eb-8f85-a83fe141f30a.png) You should not have any issue. The main reason the GUI adds the tags field/column is because of how it builds the fields in the first place, it does not know head of time if a field is added to the database, or not. But hey, the code that [builds the SQL query values in the GUI are over here](https://github.com/vdm-io/Joomla-Component-Builder/blob/staging/admin/helpers/componentbuilder.php#L1748), and you are most welcome to go over that and make a pull request if you feel you have found a better implementation. But I am not going to force the tags field to be added to the table, as this will be a bad implementation and cause all sorts of pain.
studio16 commented 2020-10-08 05:20:21 +00:00 (Migrated from github.com)

Yes I overlooked the dynamic get, thanks

Op 8 okt. 2020 om 01:39 heeft Llewellynvdm notifications@github.com het volgende geschreven:


The front-end model will only look for this if you leave the tags value in the query, if you remove it like so:

TO:

OR:

You should not have any issue.

The main reason the GUI adds the tags field/column is because of how it builds the fields in the first place, it does not know head of time if a field is added to the database, or not. But hey, the code that builds the SQL query values in the GUI are over here, and you are most welcome to go over that and make a pull request if you feel you have found a better implementation.

But I am not going to force the tags field to be added to the table, as this will be a bad implementation and cause all sorts of pain.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.

Yes I overlooked the dynamic get, thanks > Op 8 okt. 2020 om 01:39 heeft Llewellynvdm <notifications@github.com> het volgende geschreven: > >  > The front-end model will only look for this if you leave the tags value in the query, if you remove it like so: > > > TO: > > > > OR: > > > You should not have any issue. > > The main reason the GUI adds the tags field/column is because of how it builds the fields in the first place, it does not know head of time if a field is added to the database, or not. But hey, the code that builds the SQL query values in the GUI are over here, and you are most welcome to go over that and make a pull request if you feel you have found a better implementation. > > But I am not going to force the tags field to be added to the table, as this will be a bad implementation and cause all sorts of pain. > > — > You are receiving this because you authored the thread. > Reply to this email directly, view it on GitHub, or unsubscribe.
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: joomla/Component-Builder#604
No description provided.