shapecode / hidden-entity-type-bundle Goto Github PK
View Code? Open in Web Editor NEWHidden entity type for Symfony forms.
Hidden entity type for Symfony forms.
Hello,
it possible to migrate
"doctrine/persistence": "^1.3|^2.0",
to
"doctrine/persistence": "^1.3|^2.0|^3.0",
Thanks
Have tried to install this with composer, within a symfony 5 project.
The installation fails because not all requirements could be solved.
Since "doctrine/doctrine-bundle": "^1.6" wont work with symfony5, can't you just modify that line in composer.json to : "doctrine/doctrine-bundle": "^1.6|^2.0" ?
Tried that out and it seems to work for me.
i use this for a long moment with php 8 without any problem i just need to use. --ignore-platform-reqs
itβs possible to update this bundle for assure a php8 compatibility ?
Hi,
I get an error saying the new value must be an array or an instance of \Traversable, "NULL" given.
when I try to submit a form with a HiddenEntityType set with multiple => true with no data.
IMO, the reverseTransform function of the ObjectToIdTransformer class should return an empty array if the $id is null and isMultiple() is true instead of null to fix that. See below:
public function reverseTransform($id)
{
if (!$id) {
if ($this->isMultiple()) {
return [];
}
return null;
}
}
Or am I wrong and I missed something?
Thank you!
When I try use this with Symfony 4, it doesn't seem to load the data?
I'm using it like the following:
->add('netgroups_hidden', HiddenEntityType::class, [
'class' => Netgroup::class,
'property' => 'name',
'data' => function ($netgroup) {
return $netgroup->getName();
},
'multiple' => true,
'required' => false,
'mapped' => false
])
Which produces the following in my form
<input type="hidden" id="people_netgroups_hidden" name="people[netgroups_hidden]">
Hi.
When I did update Syfmony from 4.2 to 4.3.9, so this component seems not working. Have you tested it on version ^4.3? I have installed version 3.2.1. My PHP is 7.2.24
Thanks.
Regards.
Uncaught PHP Exception Symfony\Component\PropertyAccess\Exception\NoSuchPropertyException: "property id is missing in class App:Domain"
at /Users/Ducho/Sites/new-website/vendor/shapecode/hidden-entity-type-bundle/src/Form/DataTransformer/ObjectToIdTransformer.php line 146
{
"exception": {}
}
App:Domain
/**
* Domain
*
* @ORM\Table(name="domain")
* @ORM\Entity(repositoryClass="App\Repository\DomainRepository")
*/
class Domain
{
/**
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
* @ORM\Column(type="integer")
*/
protected $id;
Form
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('username', TextType::class, [
'label' => 'ftp.username',
'required' => true,
'constraints' => [
new NotBlank(),
]
])
->add('domain', HiddenEntityType::class, [
'class' => 'App:Domain'
])
The "Doctrine\Common\Persistence\ManagerRegistry" service alias is deprecated, use "Doctrine\Persistence\ManagerRegistry" instead. It is being referenced by the "Shapecode\Bundle\HiddenEntityTypeBundle\Form\Type\HiddenObjectType" service.
In new versions we are need use Doctrine\Persistence\ManagerRegistry instead Doctrine\Common\Persistence\ManagerRegistry in
Shapecode\Bundle\HiddenEntityTypeBundle\Form\Type\HiddenObjectType
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.