If the path module is enabled feeds should be able to map a source field to the path alias for Nodes, Terms and Users.

CommentFileSizeAuthor
#20 feeds-path_alias-1001590-20.patch2.75 KBtwistor
#6 1001590-6_path_alias.patch1.44 KBtwistor
#4 1001590-5_path_alias.patch3.84 KBAnonymous (not verified)
#3 1001590-4_feeds-path-alias.patch967 bytesBevan
#2 1001590-3_path_alias.patch2.86 KBAnonymous (not verified)
#1 1001590_path_alias.patch2.24 KBAnonymous (not verified)
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Anonymous’s picture

FileSize
2.24 KB

See the attached patch.

Anonymous’s picture

FileSize
2.86 KB

Here's an updated patch I removed some cruft and implemented setTargetElement for UserProcessor and TermProcessor.

Bevan’s picture

Tristan;

Your patches will not apply cleanly to future versions of Feeds, as they do not include any context. Please remove -0 when you do cvs diff -up so that 2 lines of context can be included before and after each hunk. This allows the patch command to apply the patch correctly even if the file has changed in other places.

Here is the Drupal 6 version of this patch for the FeedsNodeProcessor only.

Tristan; What are you working on? It looks like we have at least a little bit of overlap in the features we are working on. I am building a lightweight port of Wordpress Import that depends on Feeds for the heavy lifting, and am implementing several new targets, including comments, comment status, sticky and others yet TBD. Perhaps we can collaborate?

Anonymous’s picture

FileSize
3.84 KB

Sorry about that here is an updated flag with the correct cvs flags. Unfortunately I don't think I'll have much time to collaborate with you in the near future I have a bunch of big projects coming up and it won't leave for much spare time. Good luck though! See the attached updated patch.

twistor’s picture

Status: Needs review » Needs work

This will most likely need tests to get in.

twistor’s picture

FileSize
1.44 KB

I think this solves the same dilemma in a simpler fashion.

elly’s picture

I was able to get the patch in #6 working great, but there is a problem where if you keep importing, it seems to create multiple aliases over and over.

allabakash.g’s picture

Version: 7.x-2.x-dev » 6.x-1.x-dev
Status: Needs work » Fixed

/*
for me also, values were repeating in url_alias table for the nid,
i got the solution for that, i just make "pathauto_perfom_alias = false"(please check below)
*/

$node->path = $dst;
$node->pathauto_perform_alias = false;

Offlein’s picture

Status: Fixed » Needs work

Did this actually make it into Feeds? Or was it just marked "Fixed"?

Bevan’s picture

Version: 6.x-1.x-dev » 7.x-2.x-dev

I don't think allabakash.g realised what (s)he was doing.

dandaman’s picture

Status: Needs work » Needs review

I found the patch in #6 useful and think it should be included in an upcoming version of Feeds. This makes it very easy to import the content and import it's legacy URL at the same time.

dgastudio’s picture

Status: Needs review » Reviewed & tested by the community

#6
everything seems works fine.

Masala’s picture

#6 is working properly for feeds dev

evgeniysolodkov’s picture

it looks like #6 and pathauto both create aliases when creating an entity.
i replaced
$target_item->path['alias'] = $value;
with

$target_item->path['alias'] = $value;
$target_item->path['pathauto'] = 0;

it unchecks "Generate automatic URL alias" and make pathauto skip processing entity to avoid duplicates in url_alias table

Masala’s picture

del.

Masala’s picture

garfild812 useful addition!

Small question. It is normal, that every time you update node with url, create a new url alias for node? I have several alias for the url nodes after each it change in import.

SocialNicheGuru’s picture

will the patch be re-rolled with #15 addition?

evgeniysolodkov’s picture

Oh! You're right! I don't update my nodes, i use this import only for creating new content. I tried to update node with new url and it really creates second alias for it.
I don't think it is normal... i hope you'll find how to fix it. I myself can't do it now being short of time. luck

twistor’s picture

Status: Reviewed & tested by the community » Needs work

The bug from #16 is because path_load is not called on node_load anymore. It would need to be called manually.

So this needs to be re-evaluated. There are a few problems that are mostly my fault.

  1. There's no technical reason to depend on path.module being enabled to set aliases. In D7, path CRUD was moved to path.inc. path.module provides just the ui to manage paths.
  2. That being said, I think we probably should still check.
  3. In moving the functionality from the Node and Term Processors to the base Processor, we can set aliases for any entity. This is valid, but path.module only supports saving aliases automatically from nodes and terms.
  4. So, we would need to use the uri callback to set the alias, but on initial import, there's no id.
twistor’s picture

Status: Needs work » Needs review
FileSize
2.75 KB

Let's move this along.

The duplicate issue should be fixed.

msti’s picture

I tested the FeedsNodeProcessor patch from #20 with the aplha5 version of feeds and it is working.

nlambert’s picture

as per msti, alpha5 patched with #20 works great

twistor’s picture

Version: 7.x-2.x-dev » 6.x-1.x-dev
Status: Needs review » Patch (to be ported)
franz’s picture

Anyone wondering why you're alias is not being saved: #1665450: Path alias target when using pathauto

ryumkin’s picture

Not exists in 7-x!!! When?

twistor’s picture

It's in 7.x. I don't understand your question.

coderintherye’s picture

he's probably alluding to the fact that not all of this is in the alpha7 even though the release notes say it is. Either that or some drush wonkiness. I'll see if I can narrow down since it seems like the pathauto patches are applying cleanly still.

rohit.wadhwa’s picture

Version: 6.x-1.x-dev » 7.x-2.0-alpha7

I tested the FeedsNodeProcessor patch from #20 with the 7.x-2.0-alpha7 version of feeds and it is working.
But after this i am not able to open view listing page and also notable to disable the feed module.
After undo the patch both are again working may be there are some issues which not suitable for views and also make an impact on disable module.

franz’s picture

Status: Patch (to be ported) » Postponed (maintainer needs more info)

Can you test on a clean installation? I think it's rather odd that this patch would cause this.

twistor’s picture

Version: 7.x-2.0-alpha7 » 6.x-1.x-dev
Status: Postponed (maintainer needs more info) » Patch (to be ported)

Please open a follow up if you're not getting the path mapper.

twistor’s picture

Category: task » feature
jelo’s picture

Was this ever committed to 6.x? I just updated from 6.x-1.0-beta11 to 6.x-1.0-beta13, but I do not get a selection in the Target drop down for "path alias". This would definitely be useful as I need to bring in a defined alias from an external source and can't let pathauto create automatic aliases.

llillf’s picture

Issue summary: View changes

I have the same question, was the patch committed to 6.x? Thanks a lot!!!

twistor’s picture

Status: Patch (to be ported) » Closed (outdated)