If I want to create a mapping, without adding (manage) a field previously I get the following error message:

Notice: Undefined index: field in knowledge_graph_form_submit() (line 273 of /var/www/development.local/htdocs/sites/all/modules/knowledge_graph/includes/Controller/KnowledgeGraphEntityUIController.php).
    Warning: Invalid argument supplied for foreach() in knowledge_graph_form_submit() (line 295 of /var/www/development.local/htdocs/sites/all/modules/knowledge_graph/includes/Controller/KnowledgeGraphEntityUIController.php).

Comments

steffenr’s picture

Assigned: Unassigned » steffenr

I'll have a look - looks like a missing check for expected data that is missing while submitting the form w/o mapping fields.

steffenr’s picture

Attached a patch solving the issue..

I also updated the validation function to check for at least one field mapping.

steffenr’s picture

Assigned: steffenr » cyberschorsch
Status: Active » Needs review
medienverbinder’s picture

I have added the patch from #2. If I want to create a mapping without adding (manage) a field previously, now I get a system message:

=> "You can not save a mapping without adding somefield mappings."

Everything works as intended.

steffenr’s picture

Thx @medienverbinder. As you might have noticed we are also fixing some other issues we found playing around with the module on our testing sites.
We'll update the latest DEV release with the latest patches if everything works as expected..

SteffenR

cyberschorsch’s picture

Status: Needs review » Needs work

This still need some work. I think we should tell the user right from the start that there are no maps to be mapped. We should also include a direct link to the "manage fields" page of the type if the field_ui module is enabled. If not, it should be simplified to a message that the user has to create fields and field_ui should be enabled for that.

cyberschorsch’s picture

Assigned: cyberschorsch » Unassigned