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

Tags page error after re-organising all tags from an imported transaction #997

Closed
AndreiGavriliu opened this issue Nov 16, 2017 · 7 comments
Assignees
Labels
bug Verified and replicated bugs and issues. fixed Bugs that are fixed (in a coming release).
Milestone

Comments

@AndreiGavriliu
Copy link

I am running Firefly III version 4.6.10

Description of my issue:

I just re-organised one of the automatically imported transactions and now cannot access the tags page.

Steps to reproduce

  1. renamed transaction
  2. changed budget
  3. removed all tags
  4. changed category

Other important details (log files, system info):

I enabled the debug mode:

Illuminate \ Database \ QueryException (23000)
SQLSTATE[23000]: Integrity constraint violation: 1052 Column 'id' in order clause is ambiguous (SQL: select * from `tags` left join `tag_transaction_journal` on `tag_transaction_journal`.`tag_id` = `tags`.`id` left join `transaction_journals` on `tag_transaction_journal`.`transaction_journal_id` = `transaction_journals`.`id` left join `transactions` on `transaction_journals`.`id` = `transactions`.`transaction_journal_id` where `tags`.`user_id` = 1 and `tags`.`user_id` is not null and `transactions`.`amount` > 0 and `tags`.`date` is null and `tags`.`deleted_at` is null group by `tags`.`id` order by `id` desc)
/var/www/firefly-iii/vendor/laravel/framework/src/Illuminate/Database/Connection.php
     * @param  array     $bindings
     * @param  \Closure  $callback
     * @return mixed
     *
     * @throws \Illuminate\Database\QueryException
     */
    protected function runQueryCallback($query, $bindings, Closure $callback)
    {
        // To execute the statement, we'll simply call the callback, which will actually
        // run the SQL against the PDO connection. Then we can calculate the time it
        // took to execute and log the query SQL, bindings and time in our memory.
        try {
            $result = $callback($query, $bindings);
        }
 
        // If an exception occurs when attempting to run a query, we'll format the error
        // message to include the bindings with SQL, which will make this exception a
        // lot more helpful to the developer instead of just the database's errors.
        catch (Exception $e) {
            throw new QueryException(
                $query, $this->prepareBindings($bindings), $e
            );
        }
 
        return $result;
    }
 
    /**
     * Log a query in the connection's query log.
     *
     * @param  string  $query
JC5 added a commit that referenced this issue Nov 17, 2017
@JC5
Copy link
Member

JC5 commented Nov 17, 2017

Thanks for the debug info, found it! It should be fixed :)

@JC5 JC5 self-assigned this Nov 17, 2017
@JC5 JC5 added bug Verified and replicated bugs and issues. fixed Bugs that are fixed (in a coming release). labels Nov 17, 2017
@JC5 JC5 added this to the 4.6.11 milestone Nov 17, 2017
@AndreiGavriliu
Copy link
Author

Now I get the following error:

“SQLSTATE[42000]: Syntax error or access violation: 1055 'firefly.tags.created_at' isn't in GROUP BY (SQL: select * from `tags` left join `tag_transaction_journal` on `tag_transaction_journal`.`tag_id` = `tags`.`id` left join `transaction_journals` on `tag_transaction_journal`.`transaction_journal_id` = `transaction_journals`.`id` left join `transactions` on `transaction_journals`.`id` = `transactions`.`transaction_journal_id` where `tags`.`user_id` = 1 and `tags`.`user_id` is not null and `transactions`.`amount` > 0 and `tags`.`date` is null and `tags`.`deleted_at` is null group by `tags`.`id` order by `tags`.`id` desc) “

@JC5
Copy link
Member

JC5 commented Nov 17, 2017

I’ll have to fix it later today and update my own MySQL installation. Stay tuned :)

@AndreiGavriliu
Copy link
Author

Great. Let me know if you need anything from me

JC5 added a commit that referenced this issue Nov 17, 2017
JC5 added a commit that referenced this issue Nov 17, 2017
@JC5
Copy link
Member

JC5 commented Nov 17, 2017

I found it, should be fixed!

@AndreiGavriliu
Copy link
Author

Looks good! TBH, I was not expecting such a quick fix. Thank you!

@JC5
Copy link
Member

JC5 commented Nov 17, 2017

👍

@JC5 JC5 closed this as completed Nov 17, 2017
JC5 added a commit that referenced this issue Nov 17, 2017
@lock lock bot locked as resolved and limited conversation to collaborators Jan 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Verified and replicated bugs and issues. fixed Bugs that are fixed (in a coming release).
Projects
None yet
Development

No branches or pull requests

2 participants