Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

form generator problem critical issue ! #436

Open
roozbeh360 opened this issue Jan 12, 2013 · 4 comments
Open

form generator problem critical issue ! #436

roozbeh360 opened this issue Jan 12, 2013 · 4 comments

Comments

@roozbeh360
Copy link

a few days ago i had found and strange behavior in form generator .
my model was using dmVersionable doctrine behavior , after building front widgets i saw version filed in form ! very strange .

i was trace the model form base files and i see this :

//one to many
if($this->needsWidget('version_list')){
$this->setWidget('version_list', new sfWidgetFormDmPaginatedDoctrineChoice(array('multiple' => true, 'model' => 'RegisterDriverVersion', 'expanded' => true)));
$this->setValidator('version_list', new sfValidatorDoctrineChoice(array('multiple' => true, 'model' => 'RegisterDriverVersion', 'required' => false)));
}

so i ask group for help on that .

Nikola Svitlica ( @TheCelavi ) was giving me very very good advice on that and i appreciate that but after changes still there was a problems !

new field appears as :

'version' => new sfWidgetFormInputText()

and dm media appears as:

'image' => new sfWidgetFormDmDoctrineChoice

Untitled

i think it's better does who have knowledge on dm form generator fix this bug .

thank you so much community .

@TheCelavi
Copy link
Member

Could not reproduce?!?!?!

I have started from scratch and everything worked fine for me without any modifications.

Form generates version_list widget - but event though, everything works as it suppose to work.

I can add, edit and delete objects as well as do revert of it.

So I can not confirm this as a bug. If someone else can - I will dig into it.

For @roozbeh360 - either manually remove version_list (if that works for you) or save your code in modules/YourModuleAdmin and start from scratch and gradually add your logic.

I am so sorry for not being more helpful.

If no one confirms this issue in upcoming month - I will have to close this issue as "could not reproduce"

Best.

@roozbeh360
Copy link
Author

ok thanks any way .

@TheCelavi
Copy link
Member

Ok, usually, I always create my custom filter form for Front, and I use in admin generators the Diem ones.

Now, when I have used the Diem generated form filter for Front just by calling 'new MyFilterForm()' I got error regarding version::getPrimaryKey.

Everything works in admin as it should, but it seems that it is not intent to be used in Front app out of the box.

Solution: in action I did this:

$this->filterForm = new MyFilterForm();
$this->filterForm->useFields(array('field1', 'field2'....etc...));

Which is fine by me... If admin does work for you (@roozbeh360) - and you have this kind of issue, do not try to fix it - it will brake the admin.

It is best to have generated MyFilterForm() and you create class MyFrontFilterForm extends MyFilterForm and in method setup or configure do the magic regarding the fields.

Please notify me if this helps.

@roozbeh360
Copy link
Author

actually i don't have problem in admin app and filters form ether !

my problem is :

when i using

config/dm/modules.yml

and adding these line to build form widget for front app

Automation:
RegisterDriver:
RegisterDriver:
components:
form:

when form drag and drops on page and begin rendered it shows few unexpected fields :
like : list_widgets

if you still have my model please test this .

thanks .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants