Okay, so everything is looking great, but we're back to the entity alias issue again.

I've noticed that when I run a import from drush, two things happen:

  1. When listings are processed, they receive an alias of default/entity_id - pathauto pattern
  2. When photos are processed, they cause a new alias to be generated, except with the correct URI- drealty_listing/entity_id

The result is a duped alias (path/path, path/path-0, etc).

I did a little poking around and found that by changing line 520 in the daemon:

$item = new Entity(array('conid' => $connection->conid, 'type' => $class->bundle), $entity_type);

to

$item = entity_create($entity_type,, array('conid' => $connection->conid, 'type' => $class->bundle));

this problem went away completely.

Attached is a patch for review, to see if you see what I see.

CommentFileSizeAuthor
#7 drealty_pathauto.patch8.61 KBtwod
#1 1512700.patch858 byteskevinquillen

Comments

kevinquillen’s picture

StatusFileSize
new858 bytes

Patch. And, ignore the double comma in OP. Can't edit it.

kevinquillen’s picture

Status: Active » Needs review
kevinquillen’s picture

Status: Needs review » Fixed

I can confirm that this change is definitely working. I've committed it to dev.

kevinquillen’s picture

Version: 7.x-3.0-beta1 » 7.x-3.x-dev
j9’s picture

Hi kevinquillen,

Am I correct that you are using drealty entity fields and passing them to pathauto to format the urls?

If so, how are you doing this? I do not see entity field options from drealty in the pathauto options.

Thanks very much!

camidoo’s picture

you'll need this module to make that work j9:

http://drupal.org/sandbox/damz/1332096

twod’s picture

StatusFileSize
new8.61 KB

Cool, I didn't know about that module, so I put together the beginnings of my own pathauto patch for drealty.
The differences I see is that my patch supports individual patterns for listing classes whereas the module only allows one pattern, but my patch doesn't yet support batched alias deletion.

Edit: I just noticed this patch included the drealty-class token as well so, one doesn't need my last patch from the token issue if using this.

j9’s picture

camidoo - thanks! Damien's Pathauto integration for all Entity Types works like a charm! :D

kevinquillen’s picture

Here is a doc page on setting this up:

Aliasing Listings

Status: Fixed » Closed (fixed)

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

duntuk’s picture

Noted in another alias issue:

As of right now, you can do this with the latest version of drealty, pathauto, and Entity API module: specifically enable "Entity Tokens" and you'll see them listed under pathauto patterns.

Cheers.