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

Fix dynamic taggable table name #520

Merged
merged 1 commit into from
Dec 9, 2024
Merged

Fix dynamic taggable table name #520

merged 1 commit into from
Dec 9, 2024

Conversation

xalunda
Copy link
Contributor

@xalunda xalunda commented Oct 21, 2024

Hello,

Going from 4.6.1 to 4.7.0 broke the syncTagIds method by changing $this->getTaggableTableName() . '.tag_id', to forced 'taggables.tag_id',

I'm using a custom taggable table name, resulting in this SQL error:

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'taggables.tag_id' in 'on clause' (Connection: mysql, SQL: select `tag_id` from `spatie_taggables` inner join `spatie_tags` on `taggables`.`tag_id` = `spatie_tags`.`id` [...]

config:

    /*
     * The name of the table associated with the taggable morph relation.
     */
    'taggable' => [
        'table_name' => 'spatie_taggables',
        'morph_name' => 'taggable',
    ],

Changing it back to $this->getTaggableTableName() . '.tag_id', restored functionality.

Let me know if you need anything else.

@xalunda
Copy link
Contributor Author

xalunda commented Nov 21, 2024

Up

@freekmurze freekmurze merged commit e801705 into spatie:main Dec 9, 2024
1 check passed
@freekmurze
Copy link
Member

Thanks!

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

Successfully merging this pull request may close these issues.

2 participants