Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Model::first() ambiguous id error #903

Closed
daylightstudio opened this issue Jan 14, 2018 · 2 comments
Closed

Model::first() ambiguous id error #903

daylightstudio opened this issue Jan 14, 2018 · 2 comments

Comments

@daylightstudio
Copy link
Contributor

I'm getting errors when I have a join on my Model. I'd recommend adding the table's prefix:

$builder->orderBy($this->table . '.' . $this->primaryKey, 'asc');

https://github.com/bcit-ci/CodeIgniter4/blob/1b8c4914e139f6bb20a4b949e019c4412a00c053/system/Model.php#L422

@daylightstudio
Copy link
Contributor Author

The find method also could use the table prefix on lines 316 and 322.

@lonnieezell
Copy link
Member

My time's extremely limited right now due to work. In the future - Pull Requests are a much faster way of getting these changes incorporated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants