In admin side, I need to join a table with a key field not present in the main table (which is always aliased as 'a'), but with a key field in a table joined by the model query anyway.
With the PHP custom block inserted just after the from table, and before all the join(s), we are not able to use any fields of tables that will be joined below because they are not known yet at this stage and we get a mySql error "unknown colum XYZ in ON clause..."
The custom PHP block should be moved after all the model select(s) and join(s) at least.
In this case we can use all the joined tables (and their fields) and even the clear method to refine the query if needed.
Inserted in the current position we can only interact with the main table with a custom PHP.
Expected result
Actual result
System information (as much as possible)
OS Name & Version:
MySql Version:
Apache Version:
PHP Version:
Joomla Version:
JCB Version:
Browser:
Additional comments
### Steps to reproduce the issue
In admin side, I need to join a table with a key field not present in the main table (which is always aliased as 'a'), but with a key field in a table joined by the model query anyway.
With the PHP custom block inserted just after the **from** table, and before all the join(s), we are not able to use any fields of tables that will be joined below because they are not known yet at this stage and we get a mySql error "_unknown colum XYZ in **ON** clause..._"
The custom PHP block should be moved after all the model select(s) and join(s) at least.
In this case we can use all the joined tables (and their fields) and even the **clear** method to refine the query if needed.
Inserted in the current position we can only interact with the main table with a custom PHP.
### Expected result
### Actual result
### System information (as much as possible)
- OS Name & Version:
- MySql Version:
- Apache Version:
- PHP Version:
- Joomla Version:
- JCB Version:
- Browser:
### Additional comments
There are different use cases here, and moving the field will break the implementation of other. I will take a look and see if we can add another field instead.
There are different use cases here, and moving the field will break the implementation of other. I will take a look and see if we can add another field instead.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Steps to reproduce the issue
In admin side, I need to join a table with a key field not present in the main table (which is always aliased as 'a'), but with a key field in a table joined by the model query anyway.
With the PHP custom block inserted just after the from table, and before all the join(s), we are not able to use any fields of tables that will be joined below because they are not known yet at this stage and we get a mySql error "unknown colum XYZ in ON clause..."
The custom PHP block should be moved after all the model select(s) and join(s) at least.
In this case we can use all the joined tables (and their fields) and even the clear method to refine the query if needed.
Inserted in the current position we can only interact with the main table with a custom PHP.
Expected result
Actual result
System information (as much as possible)
Additional comments
There are different use cases here, and moving the field will break the implementation of other. I will take a look and see if we can add another field instead.
Great!
Thank you!