Comments (20)
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.
I just created a pull request for compatibility : #65
I let you check if it's ok for you. :-)
Thanks.
from comurimagebundle.
Hi,
Thanks for this investment. Can someone check it on SF3 ? I don't have yet any project on SF3
from comurimagebundle.
@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.
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.
@anthonyherve oooh, nice work dude. thumbs up
from comurimagebundle.
@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.
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.
@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.
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.
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.
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.
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.
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.
@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.
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.
Hi @joskewie
You need to use
->add('image', CroppableImageType::class, array(...
as described in 1.3 readme
from comurimagebundle.
aha thanks! checked the wrong readme indeed, works now
from comurimagebundle.
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.
Please check with last release
from comurimagebundle.
Related Issues (20)
- Remove dependency on dev/master of jms/translation-bundle HOT 1
- JSON Parse Symfony 3 HOT 1
- Does the bundle support ajax? drag and drop feature?
- Unexpected token U in JSON at position 66 HOT 1
- data.result.image_upload_file is undefined in comur.imagelibrary.js:67:1 HOT 1
- How to upload a simple Image widget with ComurImageBundle? HOT 1
- unable to upload on php7.1 due to notice HOT 3
- Support of Symfony 4.0 HOT 3
- how upload image to database any help please!! HOT 1
- Nothing happens when selecting an image HOT 1
- Can we have a new release? HOT 1
- Add alt text for image
- Symfony flex support HOT 3
- Support Symfony 5.x HOT 13
- Remove dependency on jms/translation-bundle
- Remove dependency on deprecated module twig/extensions
- composer command not installing ComurImageBundle HOT 1
- Any plans to keep updating?
- conflict with requirements symfony form (composer) HOT 1
- Amélioration du module HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from comurimagebundle.