question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Wrong deep field path for initField() on update()

See original GitHub issue

if i have a form that is defined

// this was edited to correct a typo. was originally "const rules"
const fields =[
	'name',
	'list.cat1',
	'list.cat1[].name',
	'list.cat1[].url',
	'list.cat2',
	'list.cat2[].name',
	'list.cat2[].url',
]

is it correct for me to define the rules like:

const rules = {
	'name': 'string|required|between:1,255',
	'list.cat1[].url' : 'url|required',
	'list.cat2[].url' : 'url|required',
}

when i attempt to validate the form, it appears that the nested fields are not getting validated. i.e. list.cat1[].url and list.cat2[].url

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:22 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
w-commented, Dec 23, 2016

awesome. just tried it out. works. Thanks very much for all your support and quick response!

1reaction
w-commented, Dec 22, 2016

thanks again for quick response. wierd, i just checked my code and in fact i’m doing what you recommend. I must be making a mistake somewhere that is causing different behavior.

I haven’t noticed the validation issue after update that you mention. thanks for the heads up and i’ll watch for it

Read more comments on GitHub >

github_iconTop Results From Across the Web

git-submodule Documentation - Git
git-submodule - Initialize, update or inspect submodules ... Add the given repository as a submodule at the given path to the changeset to...
Read more >
Error handling with sync—ArcGIS REST APIs
This topic discusses error cases when using the feature service's createReplica and synchronizeReplica operations.
Read more >
14 R6 - Advanced R
If one of the fields is an R6 object, you must create it inside $initialize() , not R6Class() . These consequences are described...
Read more >
How do I resolve "Cannot find module" error using Node.js?
This error can be encountered if you are require ing a module that has a missing or incorrect main field in its package.json....
Read more >
config | npm Docs
npm's built-in configuration file ( /path/to/npm/npmrc ). See npmrc for more details. Default Configs. Run npm config ls -l to see a set...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found