netgen / TagsBundle

Netgen Tags Bundle is an eZ Platform bundle for taxonomy management and easier classification of content, providing more functionality for tagging content than ezkeyword field type included in eZ Platform kernel.
https://netgen.io
GNU General Public License v2.0
48 stars 43 forks source link

Validator '%TagsValueValidator%' is unknown #115

Closed stevecohenfr closed 4 years ago

stevecohenfr commented 4 years ago

Hi,

After installing TagsBundle in my fresh eZ Platform 2.5 install I got this errors when creating a new Content type with Tags attribut :

Validator '%TagsValueValidator%' is unknown
FieldType '%eztags%' does not accept settings

Clearing cache does not fix this issue :/

Thanks

emodric commented 4 years ago

Hi.

I cannot reproduce this. On latest eZ Platform 2.5, I have successfully created the content type with tags attribute, as well as a new content of that type.

Can you provide detailed steps on how to reproduce this?

stevecohenfr commented 4 years ago

I cannot tell you how to really reproduce it... My install is not totally fresh, I start developing on it recently but have just my bundle, no custom dependencies.

Do you have an idea of what I have missed ?

I followed this instructions of release 3.4 : https://github.com/netgen/TagsBundle/blob/3.4-release/doc/INSTALL.md

Also for Roles policies, labels are not loaded, I got for exemple "role.policy.tags" instead of the real label "Tags". Maybe the extension is badly loaded ?

emodric commented 4 years ago

If you followed instructions, there's nothing really to miss. What version is installed? Can you specify step by step what do you to when you receive the error?

Translations are indeed missing, I fixed that now and will release the fix in coming days.

stevecohenfr commented 4 years ago

Here what i've done :

$> composer require netgen/tagsbundle

Using version ^3.4 for netgen/tagsbundle
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 2 installs, 0 updates, 0 removals
  - Installing lolautruche/ez-core-extra-bundle (v2.2.2): Downloading (100%)         
  - Installing netgen/tagsbundle (3.4.5): Downloading (100%)         
netgen/tagsbundle suggests installing ezsystems/eztags-ls (For editing eZ Tags content object and content class attributes in eZ Publish Legacy)
Package container-interop/container-interop is abandoned, you should avoid using it. Use psr/container instead.
Package guzzle/guzzle is abandoned, you should avoid using it. Use guzzlehttp/guzzle instead.
Package phpunit/phpunit-mock-objects is abandoned, you should avoid using it. No replacement was suggested.
Package symfony/assetic-bundle is abandoned, you should avoid using it. Use symfony/webpack-encore-pack instead.
Package zendframework/zend-code is abandoned, you should avoid using it. Use laminas/laminas-code instead.
Package zendframework/zend-eventmanager is abandoned, you should avoid using it. Use laminas/laminas-eventmanager instead.
Writing lock file
Generating autoload files
ocramius/package-versions:  Generating version class...
ocramius/package-versions: ...done generating version class
> Incenteev\ParameterHandler\ScriptHandler::buildParameters
Updating the "app/config/parameters.yml" file
> eZ\Bundle\EzPublishCoreBundle\Composer\ScriptHandler::clearCache

 // Clearing the cache for the dev environment with debug                       
 // true                                                                        

 [OK] Cache for the "dev" environment (debug=true) was successfully cleared.    

> Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::installAssets

 Trying to install assets as relative symbolic links.

 --- --------------------------------- ------------------ 
      Bundle                            Method / Error    
 --- --------------------------------- ------------------ 
  ✔   JMSTranslationBundle              relative symlink  
  ✔   BazingaJsTranslationBundle        relative symlink  
  ✔   FOSJsRoutingBundle                relative symlink  
  ✔   WhiteOctoberPagerfantaBundle      relative symlink  
  ✔   EzPlatformAdminUiBundle           relative symlink  
  ✔   EzPlatformAdminUiModulesBundle    relative symlink  
  ✔   EzPlatformAdminUiAssetsBundle     relative symlink  
  ✔   EzPlatformMatrixFieldtypeBundle   relative symlink  
  ✔   SteveCohenFRPopmeBundle           relative symlink  
 --- --------------------------------- ------------------ 

 [OK] All assets were successfully installed.                                   

> Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::installRequirementsFile
> @php bin/console bazinga:js-translation:dump web/assets --merge-domains
Installing translation files in web/assets directory
> @php bin/console assetic:dump
Dumping all dev assets.
Debug mode is on.

22:18:37 [dir+] /Users/steve/Projects/Web/ezpublish/PopMe/www/app/../web/js
22:18:37 [file+] /Users/steve/Projects/Web/ezpublish/PopMe/www/app/../web/js/c252af6.js
22:18:37 [file+] /Users/steve/Projects/Web/ezpublish/PopMe/www/app/../web/js/c252af6_modernizr_1.js
22:18:37 [file+] /Users/steve/Projects/Web/ezpublish/PopMe/www/app/../web/js/c252af6_jquery-2.1.1_2.js
22:18:37 [file+] /Users/steve/Projects/Web/ezpublish/PopMe/www/app/../web/js/c252af6_script_3.js
22:18:37 [file+] /Users/steve/Projects/Web/ezpublish/PopMe/www/app/../web/js/c252af6_bootstrap.min_4.js
22:18:37 [file+] /Users/steve/Projects/Web/ezpublish/PopMe/www/app/../web/js/c252af6_scrolltopcontrol_5.js
22:18:37 [file+] /Users/steve/Projects/Web/ezpublish/PopMe/www/app/../web/js/c252af6_slick.min_6.js
22:18:37 [file+] /Users/steve/Projects/Web/ezpublish/PopMe/www/app/../web/js/c252af6_scrolly_7.js
22:18:37 [file+] /Users/steve/Projects/Web/ezpublish/PopMe/www/app/../web/js/c252af6_sumoselect_8.js
22:18:37 [file+] /Users/steve/Projects/Web/ezpublish/PopMe/www/app/../web/js/c252af6_choosen.min_9.js
22:18:37 [file+] /Users/steve/Projects/Web/ezpublish/PopMe/www/app/../web/js/c252af6_waypoints_10.js
22:18:37 [dir+] /Users/steve/Projects/Web/ezpublish/PopMe/www/app/../web/css
22:18:37 [file+] /Users/steve/Projects/Web/ezpublish/PopMe/www/app/../web/css/9968b75.css
22:18:37 [file+] /Users/steve/Projects/Web/ezpublish/PopMe/www/app/../web/css/9968b75_part_1_bootstrap.min_1.css
22:18:37 [file+] /Users/steve/Projects/Web/ezpublish/PopMe/www/app/../web/css/9968b75_part_1_line-awesome.min_2.css
22:18:37 [file+] /Users/steve/Projects/Web/ezpublish/PopMe/www/app/../web/css/9968b75_part_1_responsive_3.css
22:18:37 [file+] /Users/steve/Projects/Web/ezpublish/PopMe/www/app/../web/css/9968b75_part_1_style_4.css
22:18:37 [file+] /Users/steve/Projects/Web/ezpublish/PopMe/www/app/../web/css/9968b75_part_2_colors_1.css
> yarn install
yarn install v1.19.0
warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json.
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
warning " > @babel/preset-react@7.0.0" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "@babel/preset-react > @babel/plugin-transform-react-display-name@7.2.0" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "@babel/preset-react > @babel/plugin-transform-react-jsx@7.3.0" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "@babel/preset-react > @babel/plugin-transform-react-jsx-self@7.2.0" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "@babel/preset-react > @babel/plugin-transform-react-jsx-source@7.5.0" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "@babel/preset-react > @babel/plugin-transform-react-jsx > @babel/plugin-syntax-jsx@7.2.0" has unmet peer dependency "@babel/core@^7.0.0-0".
warning " > sass-loader@7.3.1" has unmet peer dependency "webpack@^3.0.0 || ^4.0.0".
[4/4] Building fresh packages...
success Saved lockfile.
Done in 47.45s.
> EzSystems\EzPlatformEncoreBundle\Composer\ScriptHandler::compileAssets
Compiling all dev assets.

  RUN  Evaluating command yarn encore dev

  OUT  yarn run v1.19.0
  OUT  $ /Users/steve/Projects/Web/ezpublish/PopMe/www/node_modules/.bin/encore dev
  OUT  Running webpack ...
  OUT  
  OUT   DONE  Compiled successfully in 8404ms11:19:37 PM
  OUT  
  OUT   I  49 files written to web/assets/ezplatform/build
  OUT  Child ezplatform:
  OUT      Entrypoint ezplatform-admin-ui-layout-js = runtime.js ezplatform-admin-ui-layout-js.js
  OUT      Entrypoint ezplatform-admin-ui-bookmark-list-js = runtime.js ezplatform-admin-ui-bookmark-list-js.js
  OUT      Entrypoint ezplatform-admin-ui-content-draft-list-js = runtime.js ezplatform-admin-ui-content-draft-list-js.js
  OUT      Entrypoint ezplatform-admin-ui-content-type-create-js = runtime.js ezplatform-admin-ui-content-type-create-js.js
  OUT      Entrypoint ezplatform-admin-ui-content-type-edit-js = runtime.js ezplatform-admin-ui-content-type-edit-js.js
  OUT      Entrypoint ezplatform-admin-ui-content-type-list-js = runtime.js ezplatform-admin-ui-content-type-list-js.js
  OUT      Entrypoint ezplatform-admin-ui-content-type-view-js = runtime.js ezplatform-admin-ui-content-type-view-js.js
  OUT      Entrypoint ezplatform-admin-ui-content-type-group-list-js = runtime.js ezplatform-admin-ui-content-type-group-list-js.js
  OUT      Entrypoint ezplatform-admin-ui-language-list-js = runtime.js ezplatform-admin-ui-language-list-js.js
  OUT      Entrypoint ezplatform-admin-ui-object-state-list-js = runtime.js ezplatform-admin-ui-object-state-list-js.js
  OUT      Entrypoint ezplatform-admin-ui-object-state-group-list-js = runtime.js ezplatform-admin-ui-object-state-group-list-js.js
  OUT      Entrypoint ezplatform-admin-ui-policy-create-with-limitation-js = runtime.js ezplatform-admin-ui-policy-create-with-limitation-js.js
  OUT      Entrypoint ezplatform-admin-ui-policy-edit-js = runtime.js ezplatform-admin-ui-policy-edit-js.js
  OUT      Entrypoint ezplatform-admin-ui-role-list-js = runtime.js ezplatform-admin-ui-role-list-js.js
  OUT      Entrypoint ezplatform-admin-ui-role-view-js = runtime.js ezplatform-admin-ui-role-view-js.js
  OUT      Entrypoint ezplatform-admin-ui-role-assignment-create-js = runtime.js ezplatform-admin-ui-role-assignment-create-js.js
  OUT      Entrypoint ezplatform-admin-ui-search-js = runtime.js ezplatform-admin-ui-search-js.js
  OUT      Entrypoint ezplatform-admin-ui-section-list-js = runtime.js ezplatform-admin-ui-section-list-js.js
  OUT      Entrypoint ezplatform-admin-ui-section-view-js = runtime.js ezplatform-admin-ui-section-view-js.js
  OUT      Entrypoint ezplatform-admin-ui-trash-list-js = runtime.js ezplatform-admin-ui-trash-list-js.js
  OUT      Entrypoint ezplatform-admin-ui-content-preview-js = runtime.js ezplatform-admin-ui-content-preview-js.js
  OUT      Entrypoint ezplatform-admin-ui-location-view-js [big] = runtime.js ezplatform-admin-ui-location-view-js.js
  OUT      Entrypoint ezplatform-admin-ui-modal-location-trash-container-js = runtime.js ezplatform-admin-ui-modal-location-trash-container-js.js
  OUT      Entrypoint ezplatform-admin-ui-modal-location-trash-single-asset-js = runtime.js ezplatform-admin-ui-modal-location-trash-single-asset-js.js
  OUT      Entrypoint ezplatform-admin-ui-dashboard-js = runtime.js ezplatform-admin-ui-dashboard-js.js
  OUT      Entrypoint ezplatform-admin-ui-link-manager-list-js = runtime.js ezplatform-admin-ui-link-manager-list-js.js
  OUT      Entrypoint ezplatform-admin-ui-link-manager-view-js = runtime.js ezplatform-admin-ui-link-manager-view-js.js
  OUT      Entrypoint ezplatform-admin-ui-change-user-password-js = runtime.js ezplatform-admin-ui-change-user-password-js.js
  OUT      Entrypoint ezplatform-admin-ui-alloyeditor-js [big] = runtime.js ezplatform-admin-ui-alloyeditor-js.js
  OUT      Entrypoint ezplatform-admin-ui-content-edit-parts-js [big] = runtime.js ezplatform-admin-ui-content-edit-parts-js.js
  OUT      Entrypoint ezplatform-admin-ui-settings-datetime-format-update-js = runtime.js ezplatform-admin-ui-settings-datetime-format-update-js.js
  OUT      Entrypoint ezplatform-admin-ui-layout-css [big] = runtime.js ezplatform-admin-ui-layout-css.css ezplatform-admin-ui-layout-css.js
  OUT      Entrypoint ezplatform-admin-ui-alloyeditor-css = runtime.js ezplatform-admin-ui-alloyeditor-css.css ezplatform-admin-ui-alloyeditor-css.js
  OUT      Entrypoint ezplatform-admin-ui-content-edit-parts-css = runtime.js ezplatform-admin-ui-content-edit-parts-css.css ezplatform-admin-ui-content-edit-parts-css.js
  OUT      Entrypoint ezplatform-admin-ui-location-view-css = runtime.js ezplatform-admin-ui-location-view-css.css ezplatform-admin-ui-location-view-css.js
  OUT      Entrypoint ezplatform-admin-ui-security-base-css [big] = runtime.js ezplatform-admin-ui-security-base-css.css ezplatform-admin-ui-security-base-css.js
  OUT      Entrypoint ezplatform-admin-ui-modules-udw-js [big] = runtime.js ezplatform-admin-ui-modules-udw-js.js
  OUT      Entrypoint ezplatform-admin-ui-modules-mfu-js = runtime.js ezplatform-admin-ui-modules-mfu-js.js
  OUT      Entrypoint ezplatform-admin-ui-modules-subitems-js = runtime.js ezplatform-admin-ui-modules-subitems-js.js
  OUT      Entrypoint ezplatform-admin-ui-modules-content-tree-js = runtime.js ezplatform-admin-ui-modules-content-tree-js.js
  OUT  Done in 10.45s.
  OUT  
  RES  Command finished

> @php bin/security-checker security:check
Symfony Security Check Report
=============================

1 packages have known vulnerabilities.

After that I added this to my AppKernel.php

new Lolautruche\EzCoreExtraBundle\EzCoreExtraBundle(),
new Netgen\TagsBundle\NetgenTagsBundle(),

This at the really end of app/config/routing.yml

#
# Netgen tags
#
netgen_tags:
    resource: "@NetgenTagsBundle/Resources/config/routing.yml"

Imported the db :

mysql -uroot -proot  mydb < vendor/netgen/tagsbundle/bundle/Resources/sql/mysql/schema.sql

(dont worry -uroot -proot is for my local env ^^)

And give the 'Read' permisions to the 'Tags' module for the Anonymous role

Nothing else.

In back office, i create a new content type, add the Tags attribute. And got this errors :

Validator '%TagsValueValidator%' is unknown
FieldType '%eztags%' does not accept settings
This value is not valid.

The This value is not valid. is because Maximum number of allowed tags is empty.

Thanks,

stevecohenfr commented 4 years ago

Here are the logs when I save my content type with Tags attribute : https://pastebin.com/iEyVQB2d

Maybe you can find here the reason ?

emodric commented 4 years ago

The process is pretty much normal, no errors there. I'm curious: where do you get the errors about known validator and settings? Because I only get the "This value is not valid" if I put an empty value max tags (not 0). With 0, it saves fine.

image

stevecohenfr commented 4 years ago

Same place :

Capture d’écran 2020-01-09 à 15 48 27
emodric commented 4 years ago

Still can't reproduce :/

Which version of eZ kernel and repo forms are you running? (composer show ezsystems/ezpublish-kernel, composer show ezsystems/repository-forms)

stevecohenfr commented 4 years ago
steve@MacBook-Pro-de-Steve:~/Projects/Web/ezpublish/PopMe/www$ composer show ezsystems/ezpublish-kernel
name     : ezsystems/ezpublish-kernel
descrip. : Kernel used by ezsystems/ezplatform and derivatives. Provides the Content Repository, its APIs, and the application's Symfony framework integration.
keywords :
versions : * v7.5.5
type     : library
license  : GNU General Public License v2.0 only (GPL-2.0-only) (OSI approved) https://spdx.org/licenses/GPL-2.0-only.html#licenseText
source   : [git] https://github.com/ezsystems/ezpublish-kernel.git 6ae498e74fc9aed1495647bf79879d846c75d0fe
dist     : [zip] https://api.github.com/repos/ezsystems/ezpublish-kernel/zipball/6ae498e74fc9aed1495647bf79879d846c75d0fe 6ae498e74fc9aed1495647bf79879d846c75d0fe
names    : ezsystems/ezpublish-kernel, ezsystems/ezpublish, ezsystems/ezpublish-api, ezsystems/ezpublish-spi

autoload
psr-4
EzSystems\PlatformInstallerBundle\ => eZ/Bundle/PlatformInstallerBundle/src
EzSystems\PlatformBehatBundle\ => eZ/Bundle/PlatformBehatBundle
psr-0
eZ => .

requires
doctrine/doctrine-bundle ~1.6
ext-ctype *
ext-curl *
ext-fileinfo *
ext-intl *
ext-json *
ext-mbstring *
ext-pdo *
ext-spl *
ext-xsl *
ezsystems/doctrine-dbal-schema ^0.1
friendsofsymfony/http-cache-bundle ^1.3.13 | ^2.5.1
hautelook/templated-uri-bundle ^2.1
jms/translation-bundle ^1.4
kriswallsmith/buzz ^0.17.2
liip/imagine-bundle ^2.1
nelmio/cors-bundle ^1.5.0
ocramius/proxy-manager ^2.1
oneup/flysystem-bundle ^3.0
pagerfanta/pagerfanta ^2.0
php ^7.1
sensio/distribution-bundle ^5.0.22
sensio/framework-extra-bundle ^5.2
symfony-cmf/routing ^2.1
symfony/symfony ^3.4.17
twig/twig ^2.10

requires (dev)
brianium/paratest ^2.2
ezsystems/behatbundle ^6.4
friendsofphp/php-cs-fixer ~2.15.0
jenner/simple_fork ^1.2
matthiasnoback/symfony-dependency-injection-test ~3.0
phpunit/phpunit ^7.0
symfony/assetic-bundle ~2.8.2

suggests
php-64bit For support of more than 30 languages, a 64bit php installation on all involved prod/dev machines is required

conflicts
doctrine/dbal 2.7.0
ezsystems/ezpublish-legacy <2019.03
symfony/symfony 3.4.7

replaces
ezsystems/ezpublish *
ezsystems/ezpublish-api self.version
ezsystems/ezpublish-spi self.version
steve@MacBook-Pro-de-Steve:~/Projects/Web/ezpublish/PopMe/www$ composer show ezsystems/repository-forms
name     : ezsystems/repository-forms
descrip. : Use Symfony forms with eZ Platform repository objects
keywords :
versions : * v2.5.4
type     : ezplatform-bundle
license  : GNU General Public License v2.0 only (GPL-2.0-only) (OSI approved) https://spdx.org/licenses/GPL-2.0-only.html#licenseText
source   : [git] https://github.com/ezsystems/repository-forms.git 968e0205b46e23d9f07e11eab6992f057738ab80
dist     : [zip] https://api.github.com/repos/ezsystems/repository-forms/zipball/968e0205b46e23d9f07e11eab6992f057738ab80 968e0205b46e23d9f07e11eab6992f057738ab80
names    : ezsystems/repository-forms

autoload
psr-4
EzSystems\RepositoryFormsBundle\ => bundle
EzSystems\RepositoryForms\ => lib
EzSystems\RepositoryForms\Features\ => features

requires
ezsystems/ezpublish-kernel ^7.0
jms/translation-bundle ^1.3
php ^7.1
symfony/symfony ^3.4

requires (dev)
behat/behat ^3.0
friendsofphp/php-cs-fixer ^2.7
matthiasnoback/symfony-dependency-injection-test ~1.0|~2.0
phpunit/phpunit ^5.7|^6.0

conflicts
symfony/symfony 2.7.11

I tried with php 7.3.1 and 7.1.26

emodric commented 4 years ago

Those are not the latest versions. Have you tried running composer update to see if it will fix the problem? Although, I don't see any relevant changes in later versions.

Maybe you could ask on eZ Community Slack to see if anyone else has run into this problem?

stevecohenfr commented 4 years ago

I tried in another project (my sandbox of ezp 2.5). Same errors :/

I will try to upgrade and if got the same error will ask on slack. Thank you for your help.

stevecohenfr commented 4 years ago

I ran composer update

And now my sandbox is broken ^^

Attempted to call an undefined method named "setConfigResolver" of class "eZ\Publish\Core\MVC\Symfony\Security\Authentication\RepositoryAuthenticationProvider".
emodric commented 4 years ago

What changed during composer update ? This does not sound related to tags bundle :/

stevecohenfr commented 4 years ago

So, I made a REALY fresh install of ezplatform from the ezplatform doc, without any modification in the conf or anything else. Installed your bundle, and I got the same error... I don't know what is wrong with me ^^ I will try to debug. Any idea from where i can start to put my var_dumps; die; ? ^^

emodric commented 4 years ago

Somwhere in the tags type class I guess.

I will do the same, I will install a fresh version of eZ and test!

emodric commented 4 years ago

No issues whatsoever on a clean eZ Platform 2.5.8 install :/ Content type is either created without issues, or I get a regular "This value is not valid" if I put an empty max tags value.

stevecohenfr commented 4 years ago

Hmm, i found that this exception Validator '%TagsValueValidator%' is unknown is thrown from vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/FieldType/FieldType.php:159 and not from vendor/netgen/tagsbundle/bundle/Core/FieldType/Tags/Type.php:276

emodric commented 4 years ago

That's normal, that is the generic eZ kernel code that checks the validity of the field. Why it doesn't trigger for me is a million dollar question :D

emodric commented 4 years ago

Although, now that I read it a bit more, vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/FieldType/FieldType.php:159 should not be executed, because that method is overriden in the tags field type. Weird indeed.

stevecohenfr commented 4 years ago

OMG found it...

I registered your bundle before "eZ Systems" in the AppKernel... I moved it at the end of dependencies and now it works fine. I want to kill myself ^^

stevecohenfr commented 4 years ago

Now "Maximum number of allowed tags" is prefilled with 0, and everything works fine. Sorry for my mistake and thank you very much for your time !

emodric commented 4 years ago

I'm glad you solved it! :)