Giter Club home page Giter Club logo

Comments (20)

antonskv avatar antonskv commented on June 20, 2024 1

I also looked into upgrading to Sym3.0 and this issue of deprecated code came from the check-list for upgrade.

Profiler shows this message:
"DEPRECATED - Defining the getGlobals() method in the "comur_thumb_extension" extension without explicitly implementing Twig_Extension_GlobalsInterface is deprecated since version 1.23"

I looked around and found that this should be an easy fix. I think the deprecated message comes from Twig extension class: /vendor/comur/image-bundle/Comur/ImageBundle/Twig/ThumbExtension.php

Line #4:
class ThumbExtension extends \Twig_Extension

Change to:
class ThumbExtension extends \Twig_Extension implements \Twig_Extension_GlobalsInterface

And /vendor/comur/image-bundle/Comur/ImageBundle/Resources/config/routing.yml syntax needs to change "pattern: " to "path: ".

I hope it's an only thing that needs to be done for this bundle to be Sym3.0 compliant.

from comurimagebundle.

anthonyherve avatar anthonyherve commented on June 20, 2024 1

I just created a pull request for compatibility : #65
I let you check if it's ok for you. :-)

Thanks.

from comurimagebundle.

comur avatar comur commented on June 20, 2024

Hi,
Thanks for this investment. Can someone check it on SF3 ? I don't have yet any project on SF3

from comurimagebundle.

antonskv avatar antonskv commented on June 20, 2024

@comur I never done major version upgrade for Symfony, so i'm still in process resolving all of my own code before getting it to work and some 3rd party bundles which are also pending update. But i'll write when i get it to work and i'll let you know the results.

from comurimagebundle.

anthonyherve avatar anthonyherve commented on June 20, 2024

Hi,
Here a first list of deprecated calls using Symfony 2.8

  • The "pattern" option in file "/srv/www/symfony28/vendor/comur/image-bundle/Comur/ImageBundle/Resources/config/routing.yml" is deprecated since version 2.2 and will be removed in 3.0. Use the "path" option in the route definition instead. (3 times) Show stack trace
  • Comur\ImageBundle\Form\Type\CroppableImageType: The FormTypeInterface::getName() method is deprecated since version 2.8 and will be removed in 3.0. Remove it from your classes. Use getBlockPrefix() if you want to customize the template block prefix. This method will be added to the FormTypeInterface with Symfony 3.0. Show stack trace
  • Accessing type "comur_image" by its string name is deprecated since version 2.8 and will be removed in 3.0. Use the fully-qualified type class name "Comur\ImageBundle\Form\Type\CroppableImageType" instead. Show stack trace
  • The Symfony\Component\OptionsResolver\OptionsResolver::setNormalizers method is deprecated since version 2.6 and will be removed in 3.0. Use setNormalizer() instead. Show stack trace
  • Comur\ImageBundle\Form\Type\CroppableImageType: The FormTypeInterface::setDefaultOptions() method is deprecated since version 2.7 and will be removed in 3.0. Use configureOptions() instead. This method will be added to the FormTypeInterface with Symfony 3.0. Show stack trace
  • Accessing type "text" by its string name is deprecated since version 2.8 and will be removed in 3.0. Use the fully-qualified type class name "Symfony\Component\Form\Extension\Core\Type\TextType" instead. Show stack trace
  • Defining the getGlobals() method in the "comur_thumb_extension" extension without explicitly implementing Twig_Extension_GlobalsInterface is deprecated since version 1.23. Show stack trace

I'll try to fork project and correct these calls.

from comurimagebundle.

antonskv avatar antonskv commented on June 20, 2024

@anthonyherve oooh, nice work dude. thumbs up

from comurimagebundle.

comur avatar comur commented on June 20, 2024

@anthonyherve thanks for this work !
@antonskv do you have time and ability to check it on a SF3 project ?

Thanks again, i will try to look ASAP and merge it.

from comurimagebundle.

anthonyherve avatar anthonyherve commented on June 20, 2024

I'm checking it on a SF3 project, but I have a little problem with version of jms/translation-bundle. The last stable version of this bundle is not compliant with SF3. So I put dev-master, but I have following problem :
"Invalid resource provided: "1.2"; Errors: [ERROR 1845] Element '{urn:jms:translation}reference-file': No matching global element declaration available, but demanded by the strict wildcard.

Have you already saw this problem ?

from comurimagebundle.

antonskv avatar antonskv commented on June 20, 2024

@comur I'll try to find time to start fresh AWS instance and maybe do a clean Symfony 3.0 install and add your bundle + anthonys changes from the fork. I cant get composer through update with Symfony 3.0, as mentioned above there is a whole load of 3rd party bundles which are not up to date. Our main server still runs on PHP 5.4.x, i cant even test on it.

@anthonyherve Do you have translation bundle enabled inside Dev?

I think this causes it:

if (in_array($this->getEnvironment(), array('dev', 'test'))) {
    // ...
    $bundles[] = new JMS\TranslationBundle\JMSTranslationBundle();
    // ...
}

Source: schmittjoh/JMSTranslationBundle#169

Also PHP version constraint in composer... I think that expression ::class, for resolving class names has only been added in PHP 5.5, my NetBeans pointed that out.

Source: http://php.net/manual/en/migration55.new-features.php

from comurimagebundle.

antonskv avatar antonskv commented on June 20, 2024

OK i have a AWS instance with clean PHP 5.7 and Symfony 3.0, i can just do a basic tests.

I dont mean sound stupid, but doing composer update won't work, since anothony's code is in separate bundle. I there i fancier way than just grabbing a zipball of his fork and dropping it in?

from comurimagebundle.

anthonyherve avatar anthonyherve commented on June 20, 2024

Cool news !
For your tests, I think you can clone my fork repo and add a local repo in your composer dependencies (read this article : http://marekkalnik.tumblr.com/post/22929686367/composer-installing-package-from-local-git).
Mayve you have to add "minimum-stability": "dev" in your composer.json for JMSTranslationBundle that is not stable yet.

Good luck !

I'm waiting for your answer. :-)

from comurimagebundle.

anthonyherve avatar anthonyherve commented on June 20, 2024

We have to add "prefer-stable" : true in composer.json to avoid downloading all dev versions of dependencies.
I corrected something in CroppableImageType : use setNormalizer method instead of setNormalizers.
For translations, I have same error. I have a solution but I'm not sur I can do it. It's to delete in all translation's files line jms:reference-file and xmlns:jms="urn:jms:translation" line 2.
Do you think I can do it ?

Thanks.

from comurimagebundle.

comur avatar comur commented on June 20, 2024

Hi, i will create a new branch for compatibility with SF3.
For translations, we can regenerate them all in command line to have a proper copy.

from comurimagebundle.

anthonyherve avatar anthonyherve commented on June 20, 2024

I tried to regenerate with command, but I have errors with JMSTranslationBundle. Can you try it on your side with branch symfony3 of my fork ?
Thanks.

from comurimagebundle.

antonskv avatar antonskv commented on June 20, 2024

@anthonyherve Does this run successfully? *bin/console translation:update en ComurImageBundle --force --output-format xlf *

This Symfony 3 is a major pain in the butt, i cant even partially transfer our dev site to Symfony 3. I think i just code fresh controller, Entity and fresh Symfony form to test this. I can't get anything to work, 'cause one 3rd party bundle catches on other and they all have non-compatible dependencies.

I mean i added your fork on clean Sym3 install, and initial page comes up fine, clearing cache works. Services are included and no red flags coming up.

bash-3.2# bin/console debug:container | grep comur
  comur.twig.thumb_extension                                           Comur\ImageBundle\Twig\ThumbExtension                                                       
  comur_image_bundle.gallery_type                                      Comur\ImageBundle\Form\Type\CroppableGalleryType                                            
  comur_image_bundle.image_type                                        Comur\ImageBundle\Form\Type\CroppableImageType                                              
bash-3.2# 

Composer lock file shows that ComurImageBundle is from local git (your cloned fork), so it at least installs and Symfony 3 is running.

"packages": [
        {
            "name": "comur/image-bundle",
            "version": "dev-master",
            "target-dir": "Comur/ImageBundle",
            "source": {
                "type": "git",
                "url": "/Users/anton/repositories_temp/ComurImageBundle",  <--------------
                "reference": "f149cfc9620626bce9d236d5c961e6c7813f5662"
            },
            "require": {
                "ext-gd": "*",
                "friendsofsymfony/jsrouting-bundle": "@stable",
                "jms/translation-bundle": "dev-master",
                "php": ">=5.3.2",
                "symfony/class-loader": "~2.2|3.*",
                "symfony/config": "~2.2|3.*",
                "symfony/form": "~2.2|3.*",
                "symfony/http-foundation": "~2.2|3.*",
                "symfony/routing": "~2.2|3.*",
                "symfony/twig-bridge": "~2.2|3.*",
                "symfony/validator": "~2.2|3.*",
                "twig/extensions": "~1.0",
                "twig/twig": "~1.12"
            },
            "type": "symfony-bundle",
            "extra": {
                "branch-alias": {
                    "dev-master": "1.0-dev"
                }
            },
            "autoload": {
                "psr-0": {
                    "Comur\\ImageBundle": ""
                }
            },
            "license": [
                "MIT"
            ],
            "authors": [
                {
                    "name": "Can OMUR",
                    "email": "[email protected]",
                    "homepage": "http://canomur.com"
                }
            ],
            "description": "A bundle providing fields for image upload with jquery upload and image cropping with jcrop for symfony2",
            "homepage": "https://github.com/comur/ComurImageBundle",
            "keywords": [
                "Form Type",
                "crop",
                "image",
                "jcrop",
                "jquery upload",
                "upload"
            ],
            "time": "2016-03-13 17:02:23"
        },

Just to verify the GIT is actually your fork:

bash-3.2# pwd
/Users/anton/repositories_temp/ComurImageBundle
bash-3.2# git log --name-status HEAD^..HEAD
commit 53afe425a449f1e657eee8b36668bfdfb47c36ce
Author: anthonyherve <[email protected]>
Date:   Sun Mar 13 18:15:52 2016 +0100

    Edit french translation

M       Resources/translations/ComurImageBundle.fr.xliff
bash-3.2# 

Profiler shows ComurBundle enabled and working. Assets are getting installed too:

bash-3.2# bin/console assets:install
Installing assets as hard copies.

 --- ------------------ ---------------- 
      Bundle             Method / Error  
 --- ------------------ ---------------- 
  ✔   FrameworkBundle    copy            
  ✔   ComurImageBundle   copy            
 --- ------------------ ---------------- 

 ! [NOTE] Some assets were installed via copy. If you make changes to these assets you have to run this command again.  

 [OK] All assets were successfully installed.                                    

So i don't know, seems ok. To be honest i'd love to test it by ACTUALLY using it with Entities and Forms, but can't find a free night to code a basic fresh code using it.

from comurimagebundle.

joskewie avatar joskewie commented on June 20, 2024

Anyone got this bundle working with symfony3?
I used the 1.3 branch, and followed regular installation instructions but still got a: Could not load type "comur_image" error in my formbuilder...

from comurimagebundle.

comur avatar comur commented on June 20, 2024

Hi @joskewie
You need to use
->add('image', CroppableImageType::class, array(...
as described in 1.3 readme

from comurimagebundle.

joskewie avatar joskewie commented on June 20, 2024

aha thanks! checked the wrong readme indeed, works now

from comurimagebundle.

glerendegui avatar glerendegui commented on June 20, 2024

There's still a bug at https://github.com/comur/ComurImageBundle/blob/1.3/Form/Type/CroppableImageType.php line 44.
'text' must be changed to TextType::class as in line 49

from comurimagebundle.

comur avatar comur commented on June 20, 2024

Please check with last release

from comurimagebundle.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.