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

Unknown column type_attributes.0.name #103

Open
sanPuerquitoProgramador opened this issue Dec 8, 2022 · 3 comments
Open

Unknown column type_attributes.0.name #103

sanPuerquitoProgramador opened this issue Dec 8, 2022 · 3 comments
Assignees

Comments

@sanPuerquitoProgramador
Copy link

When you try to edit an attribute in october v2.x with MySQL database the response message is

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'type_attributes.0.name' in 'where clause' (SQL: select count(*) as aggregate from ginopane_blogtaxonomy_post_typeswheretype_attributes.0.name= PDFs andid <> 2)"

To Reproduce
Steps to reproduce the behavior:

  1. a fresh and clean OctoberCMS install
  2. a fresh and clean install of RainLab Blog Plugin
  3. a fresh and clean install of taxonomy Plugin
  4. Go to Posts -> Types and create a new one
  5. Edit the type and the error is displayed
@GinoPane
Copy link
Owner

Hi! I'm not sure when I get time to look into this, so please feel free to submit a PR if you know the reason.
I didn't look in what's going on in v2, so maybe they changed something.

@chrisvidal
Copy link

same error in the plugin v3.1 when I try to save a post type

image

@chrisvidal
Copy link

the whole log is showing the origin is coming from the post_types controller on the update method calling the internal OC controller update

[2023-11-09 11:13:28] local.ERROR: PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'type_attributes.0.name' in 'where clause' in /Users/christophevidal/Sites/oc-azalea2/vendor/laravel/framework/src/Illuminate/Database/Connection.php:414
Stack trace:
#0 /Users/christophevidal/Sites/oc-azalea2/vendor/laravel/framework/src/Illuminate/Database/Connection.php(414): PDO->prepare('select count(*)...')
#1 /Users/christophevidal/Sites/oc-azalea2/vendor/laravel/framework/src/Illuminate/Database/Connection.php(753): Illuminate\Database\Connection->Illuminate\Database\{closure}('select count(*)...', Array)
#2 /Users/christophevidal/Sites/oc-azalea2/vendor/laravel/framework/src/Illuminate/Database/Connection.php(720): Illuminate\Database\Connection->runQueryCallback('select count(*)...', Array, Object(Closure))
#3 /Users/christophevidal/Sites/oc-azalea2/vendor/laravel/framework/src/Illuminate/Database/Connection.php(422): Illuminate\Database\Connection->run('select count(*)...', Array, Object(Closure))
#4 /Users/christophevidal/Sites/oc-azalea2/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(2706): Illuminate\Database\Connection->select('select count(*)...', Array, false)
#5 /Users/christophevidal/Sites/oc-azalea2/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(2694): Illuminate\Database\Query\Builder->runSelect()
#6 /Users/christophevidal/Sites/oc-azalea2/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(3230): Illuminate\Database\Query\Builder->Illuminate\Database\Query\{closure}()
#7 /Users/christophevidal/Sites/oc-azalea2/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(2695): Illuminate\Database\Query\Builder->onceWithColumns(Array, Object(Closure))
#8 /Users/christophevidal/Sites/oc-azalea2/vendor/october/rain/src/Database/QueryBuilder.php(90): Illuminate\Database\Query\Builder->get(Array)
#9 /Users/christophevidal/Sites/oc-azalea2/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(3157): October\Rain\Database\QueryBuilder->get(Array)
#10 /Users/christophevidal/Sites/oc-azalea2/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(3085): Illuminate\Database\Query\Builder->aggregate('count', Array)
#11 /Users/christophevidal/Sites/oc-azalea2/vendor/october/rain/src/Database/QueryBuilder.php(191): Illuminate\Database\Query\Builder->count('*')
#12 /Users/christophevidal/Sites/oc-azalea2/vendor/laravel/framework/src/Illuminate/Validation/DatabasePresenceVerifier.php(54): October\Rain\Database\QueryBuilder->count()
#13 /Users/christophevidal/Sites/oc-azalea2/vendor/laravel/framework/src/Illuminate/Validation/Concerns/ValidatesAttributes.php(928): Illuminate\Validation\DatabasePresenceVerifier->getCount('ginopane_blogta...', 'type_attributes...', 'Release Date', '1', 'id', Array)
#14 /Users/christophevidal/Sites/oc-azalea2/vendor/laravel/framework/src/Illuminate/Validation/Validator.php(616): Illuminate\Validation\Validator->validateUnique('type_attributes...', 'Release Date', Array, Object(October\Rain\Validation\Validator))
#15 /Users/christophevidal/Sites/oc-azalea2/vendor/laravel/framework/src/Illuminate/Validation/Validator.php(422): Illuminate\Validation\Validator->validateAttribute('type_attributes...', 'Unique')
#16 /Users/christophevidal/Sites/oc-azalea2/vendor/october/rain/src/Database/Traits/Validation.php(377): Illuminate\Validation\Validator->passes()
#17 /Users/christophevidal/Sites/oc-azalea2/vendor/october/rain/src/Database/Traits/Validation.php(82): GinoPane\BlogTaxonomy\Models\PostType->validate()
#18 /Users/christophevidal/Sites/oc-azalea2/vendor/october/rain/src/Support/Traits/Emitter.php(98): GinoPane\BlogTaxonomy\Models\PostType->October\Rain\Database\Traits\{closure}(Array, Array)
#19 /Users/christophevidal/Sites/oc-azalea2/vendor/october/rain/src/Database/Model.php(375): October\Rain\Database\Model->fireEvent('model.saveInter...', Array, true)
#20 /Users/christophevidal/Sites/oc-azalea2/vendor/october/rain/src/Database/Model.php(434): October\Rain\Database\Model->saveInternal(Array)
#21 /Users/christophevidal/Sites/oc-azalea2/modules/backend/traits/FormModelSaver.php(38): October\Rain\Database\Model->save(Array)
#22 /Users/christophevidal/Sites/oc-azalea2/vendor/laravel/framework/src/Illuminate/Database/Concerns/ManagesTransactions.php(30): Backend\Behaviors\FormController->Backend\Traits\{closure}(Object(October\Rain\Database\Connections\MySqlConnection))
#23 /Users/christophevidal/Sites/oc-azalea2/vendor/laravel/framework/src/Illuminate/Database/DatabaseManager.php(469): Illuminate\Database\Connection->transaction(Object(Closure))
#24 /Users/christophevidal/Sites/oc-azalea2/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php(338): Illuminate\Database\DatabaseManager->__call('transaction', Array)
#25 /Users/christophevidal/Sites/oc-azalea2/modules/backend/traits/FormModelSaver.php(45): Illuminate\Support\Facades\Facade::__callStatic('transaction', Array)
#26 /Users/christophevidal/Sites/oc-azalea2/modules/backend/behaviors/FormController.php(329): Backend\Behaviors\FormController->performSaveOnModel(Object(GinoPane\BlogTaxonomy\Models\PostType), Array, Array)
#27 [internal function]: Backend\Behaviors\FormController->update_onSave('1', NULL)
#28 /Users/christophevidal/Sites/oc-azalea2/vendor/october/rain/src/Extension/ExtendableTrait.php(504): call_user_func_array(Array, Array)
#29 /Users/christophevidal/Sites/oc-azalea2/vendor/october/rain/src/Extension/Extendable.php(55): October\Rain\Extension\Extendable->extendableCall('update_onSave', Array)
#30 /Users/christophevidal/Sites/oc-azalea2/modules/system/traits/DependencyMaker.php(29): October\Rain\Extension\Extendable->__call('update_onSave', Array)
#31 /Users/christophevidal/Sites/oc-azalea2/modules/backend/classes/Controller.php(635): Backend\Classes\Controller->makeCallMethod(Object(GinoPane\BlogTaxonomy\Controllers\PostTypes), 'update_onSave', Array)
#32 /Users/christophevidal/Sites/oc-azalea2/modules/backend/classes/Controller.php(452): Backend\Classes\Controller->runAjaxHandler('onSave')
#33 /Users/christophevidal/Sites/oc-azalea2/modules/backend/classes/Controller.php(260): Backend\Classes\Controller->execAjaxHandlers()
#34 /Users/christophevidal/Sites/oc-azalea2/modules/backend/classes/BackendController.php(118): Backend\Classes\Controller->run('update', Array)
#35 /Users/christophevidal/Sites/oc-azalea2/vendor/laravel/framework/src/Illuminate/Routing/Controller.php(54): Backend\Classes\BackendController->run('ginopane/blogta...')
#36 /Users/christophevidal/Sites/oc-azalea2/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(43): Illuminate\Routing\Controller->callAction('run', Array)
#37 /Users/christophevidal/Sites/oc-azalea2/vendor/laravel/framework/src/Illuminate/Routing/Route.php(260): Illuminate\Routing\ControllerDispatcher->dispatch(Object(Illuminate\Routing\Route), Object(Backend\Classes\BackendController), 'run')

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

No branches or pull requests

3 participants