- Toggle unique on node/x/map pages switches the mapping from per content type to per node.
- Toggle unique does not work at all on content type pages.
- Toggling uniques changes the order of mappings - that's a strange behavior - can we avoid this?

Comments

aron novak’s picture

StatusFileSize
new1.67 KB

I faced with a really strange problem with the menu placeholders:

$items['admin/content/node-type/'. $type_url_str .'/map/unique/%/a']
This just works.
When i replace it to:
$items['admin/content/node-type/'. $type_url_str .'/map/unique/%/%']
Menu simply refuses to accept that entry into the menu structure. Sounds scary, but seems to be true.
"Toggling uniques changes the order of mappings" - yeah, to avoid this, i'd add a new API function, somthing like:

feedapi_mapper_unique_mapping($param, $key, $unique)

$unique can be TRUE or FALSE.
In this case, it's not needed to delete the entry first and re-add as a unique.

For the first problem, i attached the patch.

alex_b’s picture

Status: Active » Needs work

"Toggling uniques changes the order of mappings" - yeah, to avoid this, i'd add a new API function"

Sounds good.

Patch contains a change to a fix that I did last night: it's feedapi_mapper_toggle_unique(), not feedapi_mapper_unique_toggle() - the menu definition was correct, but the function definition was feedapi_mapper_unique_toggle().

aron novak’s picture

StatusFileSize
new2.71 KB

This patch addresses:
- Toggle unique on node/x/map pages switches the mapping from per content type to per node.
- Toggling uniques changes the order of mappings - that's a strange behavior - can we avoid this?

Still no joy with the per-content-type menu entry. It seems this it's not the fault of the module.
Depends on #548852: feedapi_mapper_delete_mapping() breaks when mapping is defined in code to use feedapi_mapper_override_mapping().

aron novak’s picture

 /**
 * The maximum number of path elements for a menu callback
 */
define('MENU_MAX_PARTS', 7);

I've just found it in includes/menu.inc, - this is rather self-explaining why it does not work.

aron novak’s picture

StatusFileSize
new7.01 KB

It seems that embedding forms into another forms via the theme function does not work.
I just attach the patch for the record.

aron novak’s picture

Status: Needs work » Needs review
StatusFileSize
new5.04 KB

This works sane now.
In that way the mapping form is really simple, all the changes are stored immediately.

alex_b’s picture

Status: Needs review » Needs work

#6:

- feedapi_mapper_save_unique() instead of feedapi_mapper_set_unique()
- Not sure how I feel about feedapi_mapper in the URL... At least use feedapi-mapper instead of feedapi_mapper.

Thank you!

aron novak’s picture

Status: Needs work » Needs review
StatusFileSize
new5.04 KB

"Not sure how I feel about feedapi_mapper in the URL..."
Well, at least it's better to hack the core to handle longer pathes in the menu :)
And as you see i wanted to solve this with forms, but this is also really messy. If you can point me a way to go forward with #5, it's also good.

aron novak’s picture

StatusFileSize
new5.04 KB

The patch was buggy before. But the others are valid.

aron novak’s picture

Should be in FeedAPI mapper 2.0 beta 1

alex_b’s picture

Status: Needs review » Fixed

Committed. Thank you.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.