Kunstmaan / KunstmaanBundlesCMS

An advanced yet user-friendly content management system, based on the full stack Symfony framework combined with a whole host of community bundles. It provides a full featured, multi-language CMS system with an innovative page and form assembling process, versioning, workflow, translation and media managers and much more.
https://kunstmaancms.be
MIT License
403 stars 187 forks source link

Could not load type wysiwyg, urlchooser... after updating to 3.6.0 #1307

Closed getvois closed 6 years ago

getvois commented 8 years ago

Hello, i have error when trying to load kunstmaan form fields like wysiwyg, urlchooser etc seems like they are not loaded from the KunstmaanAdminBundle.

Files exist in folders and the bundle is loaded in AppKernel and services.yml contains types of fields.

Any ideas what next??

aistis- commented 8 years ago

What are the errors you get? Could you paste a code example where you using these types?

veloxy commented 8 years ago

Did you update your assets?

konstantinsp commented 8 years ago

@aistis- the error is: could not load type 'wysiwyg'.

here is my page part class.

namespace Acme\WebSiteBundle\Form\PageParts;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
use Symfony\Component\Form\FormBuilderInterface;
use Kunstmaan\MediaBundle\Validator\Constraints as Assert;
/**
 * BoatShowPagePartAdminType
 */
class BoatShowPagePartAdminType extends \Symfony\Component\Form\AbstractType
{
    /**
     * Builds the form.
     *
     * This method is called for each type in the hierarchy starting form the
     * top most type. Type extensions can further modify the form.
     * @param FormBuilderInterface $builder The form builder
     * @param array                $options The options
     *
     * @see FormTypeExtensionInterface::buildForm()
     */
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        parent::buildForm($builder, $options);
        $builder->add('image', 'media', array(
            'pattern' => 'KunstmaanMediaBundle_chooser',
            'mediatype' => 'image',
            'required' => false,
        ));
        $builder->add('imageAltText', 'text', array(
            'required' => false,
        ));
        $builder->add('city', 'text', array(
            'required' => false,
        ));
        $builder->add('name', 'text', array(
            'required' => false,
        ));
        $builder->add('data', 'wysiwyg', array(
            'required' => false,
        ));
        $builder->add('linkUrl', 'urlchooser', array(
            'required' => false,
        ));
        $builder->add('linkText', 'text', array(
            'required' => false,
        ));
        $builder->add('linkNewWindow', 'checkbox', array(
            'required' => false,
        ));
    }
    /**
     * Returns the name of this type.
     *
     * @return string The name of this type
     */
    public function getName()
    {
        return 'acme_websitebundle_boatshowpageparttype';
    }
    /**
     * Sets the default options for this type.
     *
     * @param OptionsResolver $resolver The resolver for the options.
     */
    public function configureOptions(OptionsResolver $resolver)
    {
        $resolver->setDefaults(array(
            'data_class' => '\Acme\WebSiteBundle\Entity\PageParts\BoatShowPagePart'
        ));
    }
    // BC for SF < 2.7
    public function setDefaultOptions(OptionsResolverInterface $resolver)
    {
        $this->configureOptions($resolver);
    }
}
tarjei commented 7 years ago

Hi you are probably getting this because you have upgraded Symfony to 2.8 or 3.0 when you need to refer to form components by their classname. I.e. Wysiwig::class etc.

See the Symfony upgrade documents for more information.