help to better help you:
Please: add always Joomla / JEM version and details to your posts, so we can try to reproduce your issue!
Assets - Unknown column alias in field list
Assets - Unknown column alias in field list
9 years 8 months ago - 9 years 8 months ago
Did add the rules form field in the backend so we can give some permissions and make joomla check for it.
It's not working perfectly at the moment and it needs to be tested but it will be a start.
Adding the rules field was no problem but after pressing the save button in event view there was this annoying message..
---
----
The problem is happening as Joomla is retrieving the assets table within libraries/joomla/table/table.php by
as a result it's having a few fields at default, including "alias". The assets table doesn't have such field so storing the data by using $assets->store() in that JTable file will result into an error.
to overcome this problem we can overwrite/add the store function in the table files and don't call the store function in the JTable file. In that function we're adding the code just like the code within the function in the JTable file but after the call we add an unset for the alias field.. It will mean some more code but this way we won't have any problems with it.
One weird thing is that i'm not experiencing any problem within the categories/venue view at this moment but to avoid any problem it's the best to overwrite the function.
It's not working perfectly at the moment and it needs to be tested but it will be a start.
Adding the rules field was no problem but after pressing the save button in event view there was this annoying message..
---
----
The problem is happening as Joomla is retrieving the assets table within libraries/joomla/table/table.php by
Code:
$asset = self::getInstance('Asset', 'JTable', array('dbo' => $this->getDbo())); The assets table is extending JTableNested and it's getting the alias field from there.
to overcome this problem we can overwrite/add the store function in the table files and don't call the store function in the JTable file. In that function we're adding the code just like the code within the function in the JTable file but after the call we add an unset for the alias field.. It will mean some more code but this way we won't have any problems with it.
One weird thing is that i'm not experiencing any problem within the categories/venue view at this moment but to avoid any problem it's the best to overwrite the function.
Last edit: 9 years 8 months ago by Bluefox.
Please Log in or Create an account to join the conversation.
Re: Assets - Unknown column alias in field list
9 years 8 months ago - 9 years 8 months ago
About the assets/rules:
will try to add it to a version of JEM3. it will be very basic at first.
categories: ? complex
venue: edit.own/autopublish/edit/add
event: edit.own
having JEM groups, joomla groups will result in more query's to be fired up
One other annoying thing (for me) as some of you know has to do with category's but hopefully Hoffi is able to resolve it or someone else. As an event can be attached to multiple category's we need to define what gets priority and it will need additional code to check things.
In this case it means for me that it becomes to complicated and rather let someone else tackle it. But will make a start.
will try to add it to a version of JEM3. it will be very basic at first.
categories: ? complex
venue: edit.own/autopublish/edit/add
event: edit.own
having JEM groups, joomla groups will result in more query's to be fired up
One other annoying thing (for me) as some of you know has to do with category's but hopefully Hoffi is able to resolve it or someone else. As an event can be attached to multiple category's we need to define what gets priority and it will need additional code to check things.
In this case it means for me that it becomes to complicated and rather let someone else tackle it. But will make a start.
Last edit: 9 years 8 months ago by Bluefox.
Please Log in or Create an account to join the conversation.
Re: Assets - Unknown column alias in field list
9 years 8 months ago - 9 years 8 months ago
Think i know why the problem with saving did happen with the "events" happened but not with venues/categories.
The thing is that in the event table file we do have a "function store()" and in there we have a line like
but in the function of the venues/categories it's set to
as it's set to true in the events table file it's causing problems this as we're passing that variable also to the parent function located in the JTable file. Doing so we explicit state that the fields are there and they should be updated, but as we have a missing "alias" field within the assets table it will trow in an error.
in the other views it's not a problem as the defined alias field was null and didn't had to be updated due to $updateNulls = false.
within the JTable file we have this code
and there we're passing $updateNulls.
within libraries/joomla/database/driver.php we have this code
as we're passing $updateNull with value "true" the null fields are defined with "NULL" but if it wasn't set to true we would have a continue.
it probably also clarify's another problem i had with the rules part.
The thing is that in the event table file we do have a "function store()" and in there we have a line like
Code:
public function store($updateNulls = true)
but in the function of the venues/categories it's set to
Code:
public function store($updateNulls = false)
as it's set to true in the events table file it's causing problems this as we're passing that variable also to the parent function located in the JTable file. Doing so we explicit state that the fields are there and they should be updated, but as we have a missing "alias" field within the assets table it will trow in an error.
in the other views it's not a problem as the defined alias field was null and didn't had to be updated due to $updateNulls = false.
within the JTable file we have this code
Code:
// If a primary key exists update the object, otherwise insert it.
if ($this->hasPrimaryKey())
{
$result = $this->_db->updateObject($this->_tbl, $this, $this->_tbl_keys, $updateNulls);
}
else
{
$result = $this->_db->insertObject($this->_tbl, $this, $this->_tbl_keys[0]);
}
within libraries/joomla/database/driver.php we have this code
Code:
// Prepare and sanitize the fields and values for the database query.
if ($v === null)
{
// If the value is null and we want to update nulls then set it.
if ($nulls)
{
$val = 'NULL';
}
// If the value is null and we do not want to update nulls then ignore this field.
else
{
continue;
}
}
it probably also clarify's another problem i had with the rules part.
Last edit: 9 years 8 months ago by Bluefox.
Please Log in or Create an account to join the conversation.
Re: Assets - Unknown column alias in field list
9 years 8 months ago - 9 years 8 months ago
it seems to me at this point that we can never use a store function within the table files with $updateNulls set to true if we're using rules as it will have problems with the retrieval of the assets table in the store function of JTable and think that's a big issue. Even more as the declared "alias" field within the assets table is incorrect as it basicly isn't there.
so to circumvent this problem i guess we have to:
- doublecheck things
- declare things
- alter tables to insert a default value of "null"
- override the store function within JTable just to make sure we can unset the $assets->alias and won't into a problem in case we forgot to set a default value.
so to circumvent this problem i guess we have to:
- doublecheck things
- declare things
- alter tables to insert a default value of "null"
- override the store function within JTable just to make sure we can unset the $assets->alias and won't into a problem in case we forgot to set a default value.
Last edit: 9 years 8 months ago by Bluefox.
Please Log in or Create an account to join the conversation.
Re: Assets - Unknown column alias in field list
9 years 8 months ago
seems Joomla did update things so it would be fine in the future (
link
)
but the problem will exist in earlier versions.
but the problem will exist in earlier versions.
Please Log in or Create an account to join the conversation.
Re: Assets - Unknown column alias in field list
9 years 8 months ago - 9 years 8 months ago
hmm,
that commit was from last year but it seems not to be added in the current releases.
ir probably needs to be tested a bit more: link
that commit is over here: link
but this file is in the staging branche: link
that commit was from last year but it seems not to be added in the current releases.
ir probably needs to be tested a bit more: link
that commit is over here: link
but this file is in the staging branche: link
Last edit: 9 years 8 months ago by Bluefox.
Please Log in or Create an account to join the conversation.
Time to create page: 0.642 seconds