Welcome, Guest
Username: Password: Remember me

TOPIC: FE Item View with some fields required not saving?

FE Item View with some fields required not saving? 20 Apr 2012 09:46 #2076

  • edwardcox
  • edwardcox's Avatar
  • Offline
  • Premium Member
  • Here to help.
  • Posts: 131
  • Thank you received: 26
  • Karma: 12
Low priority. But this one just came to mind as well.

When creating a Front End Layout view using only some of the fields from a Table, If one of the Fields (not 'visible' in the Item Layout Form) is a Required field you can not save the Record. "Missing Required Field" - which is true of the Record for the Table, but not for the specific Layout View Form.

Is there a way around this?

Thank you,

Edward.
Passionate Joomla! Developer and J-Cook pro evangelist.
www.jcombuilder.com - we build great Joomla!® Components so you don't have to.
The administrator has disabled public write access.

Re: FE Item View with some fields required not saving? 20 Apr 2012 09:56 #2078

  • admin
  • admin's Avatar
  • Online
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 984
  • Karma: 140
Yes you are right and it is normal.

It is a security fallback.
It doesn't appears if the entry is already correct in DB.

For example, you want to toggle the publish status on an incomplete item (one of the required fields is missing)
-> Then it shows you the error. You first have to use the correct form to issue this and edit the element.

But if the item is coherent in DB, you can open and edit in others uncomplete forms (or partial updates, as toggling value or ajax short call)

Is it right for you ?

Maybe you are talking about a bug and I should know...

By the way :
Theses checks are written in the table check() function, so you can hack or modify what you want.
TODO : If you want a different behavior depending on view or layout, use the JRequest (JInput) getVars.
Coding is now a piece of cake
The administrator has disabled public write access.

Re: FE Item View with some fields required not saving? 20 Apr 2012 10:11 #2081

  • edwardcox
  • edwardcox's Avatar
  • Offline
  • Premium Member
  • Here to help.
  • Posts: 131
  • Thank you received: 26
  • Karma: 12
Yes, I agree - not a bug at all. Just a feature (boy is that an old developers joke).
It does exactly as you described.

In my Table: blob

int Age
varchar Name (Required)
varchar Address

In one of the Front End View layout Forms:
Age ?
Address?

So, as you said it will not save Record because I did not include (purposely) the Name Field in the Form.

I shall look at the Table check() function and also into JRequest(JInput) getVars to see what I can accomplish.

Thanks again Jocelyn!

(P.S. Any chance of us getting a sneak preview of what's coming up on the Cook Dev Roadmap?) :woohoo:
Passionate Joomla! Developer and J-Cook pro evangelist.
www.jcombuilder.com - we build great Joomla!® Components so you don't have to.
The administrator has disabled public write access.

Re: FE Item View with some fields required not saving? 20 Apr 2012 10:21 #2082

  • admin
  • admin's Avatar
  • Online
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 984
  • Karma: 140
Still no public roadmap for the moment, I am hardly working on theses fields :

- Getting rid of all the stacked work of last week (I was on holidays, but present little bit in the forum)
- Migrating the website (Huge work !!!) because the last rewrite of JCook was before 1.6, so still running (but well) on 1.5. Shame on me... but the work to do is consequent !!!
- Still stabilizing the service before to go on. Speed is an enemy of quality. (In localhost I am still testing and improving the service)


About coming features for 2012 :
- N:N / 1:1 Handling
- Nested system
- Admin menus and CPanel

Is all I can say for the moment.
Coding is now a piece of cake
The administrator has disabled public write access.
The following user(s) said Thank You: edwardcox
Time to create page: 0.310 seconds

Get Started