When i use the "Change affiliate publishing options" the affiliate settings change but urls are not rewritten to the new url.

example: a node is published to:
- all affiliates
- sub1.domain.com
- sub2.domain.com

changing it to:
- sub2.domain.com

still lets the urls point to sub1.domain.com

MySQL 4.1.22
PHP 4.4.8
PHP register globals off
Apache/1.3.34 Ben-SSL/1.55

editing (clicking the edit tab) and submitting that node with no changes makes it work.

Comments

agentrickard’s picture

Component: Code » - Domain Content

You're talking about the batch editing screen provided by Domain Content, right?

The URLs are not rewritten on the content editing screen or on all pages?

Do you have the strict SEO setting turned on?

agentrickard’s picture

Have you installed the _new_ version of the URL rewrite sequence and the patch that goes with it?

derjochenmeyer’s picture

You're talking about the batch editing screen provided by Domain Content, right?

yes and i installed the _new_ version, but i get the same behaviour with both the old and the new way...

new setup:
- i copied the custom_url_rewrite_outbound() function to the end of settings.php
- removed the old common.inc patch and applied the new one...
- SEO settings enabled...

im not talking about the urls on the batch editing screen, but links on my frontpage for registered and anonymous users...

agentrickard’s picture

That is odd. Do you have a URL?

We are talking about links in the main content area, not blocks, correct?

There must be something missing in the configuration.

Are there any warnings at the top of Admin > Bulld > Domains ?

agentrickard’s picture

StatusFileSize
new45.13 KB

Oh, when you use the bulk update form, you must explicitly select the 'change affiliate publishing options' action. If you do not, the affiliate settings will not be processed. This is by design.

derjochenmeyer’s picture

http://routebook.com/

the block on the right called "Routenkommentare" (comments)

right now the site uses only one subdomain http://tirol.routebook.com/

since i dont have any clue what i could do i manually edit and submit each node for which a new comment is published

derjochenmeyer’s picture

question, if i want to write a script that updates "node relativity" related nodes with the affiliate publishing settings of a parent what do i have to update

domain_access SET (nid, realm, gid)

is that all to the url rewrite to work? there is probably an api function? since im working mobile right now i had chance to check the docs...

agentrickard’s picture

And those links are not going to the correct domain? Right now, they all point to http://tirol.routebook.com/

Are you using block cache? Page cache?

agentrickard’s picture

Which module is generating that block?

derjochenmeyer’s picture

No Cache. The links are now pointing to the right domain, because i fixed them by editing and submitting each node.

The Block is generated by a custon module/query...

SELECT
n.nid,
n.title,
comments.uid,
comments.cid,
comments.subject,
comments.timestamp,
users.name,
content_type_route.field_routenschwierigkeit_value
FROM {node} n
INNER JOIN content_type_route ON content_type_route.nid = n.nid
INNER JOIN comments ON comments.nid = n.nid
LEFT JOIN users ON users.uid = comments.uid
WHERE n.type = 'route' AND n.status = 1
ORDER BY comments.timestamp DESC LIMIT 10

while ($comment = db_fetch_object($query)) {
$title = l($comment->subject, "node/".$comment->nid);
print $title;
}

agentrickard’s picture

Category: bug » support
StatusFileSize
new29.69 KB
new38.57 KB

I tested a variant of your block successfully -- editing the parent node both through node/*/edit and the batch handler. Using code:

$query= db_query("SELECT n.nid, n.title, c.uid, c.cid, c.subject, c.timestamp FROM {node} n INNER JOIN {comments} c ON c.nid = n.nid WHERE n.status = 1 LIMIT 10");
$output = '';
while ($comment = db_fetch_object($query)) {
  $title = l($comment->subject, "node/".$comment->nid); 
  $output .= $title . '<br />';
}
print $output;

Now, the query is slightly different, but that isn't relevant.

I think there is a settings issue somewhere. There are three ways to force links to go to different domains:

1) For search request results. That is not relevant here.

2) For specific page requests (such as 'user/*/track' or 'blog/*') as defined by "Special Page Requests."

3) By turning on Search Engine Optimization -- set it to 'Rewrite all URLs to point to a single source'

In these cases, url paths are matched against the list in "Node Link Patterns." The defaut patterns are:

node/%n
comment/reply/%n
node/add/book/parent/%n
book/export/html/%n


Where %n is parsed as the node id.

Here is the issue with blocks.

1) Since they are not page requests, rule #2 does not apply to them -- unless the blocks only appear on specific pages that are mapped to the "Special Page Requests" link.

2) You must enable SEO strict in order to ensure that block links are always rewritten.

And there is another complication that may affect you. The logic inside of the URL rewrite makes the following assumption:

-- If the node is assigned to "all affiliates" then the rewritten link will always point to the main domain.
-- If the node is assigned to more than one affiliate, it will take the first match, based on domain creation order.

So this may also be the problem.

You can (as of 1.0) use the Domain Source module to specify exactly which domain you want to use when rewriting links for each node.

Attached are some shots of my configuration.

agentrickard’s picture

Note that if you wrap the above query in db_rewrite_sql(), it should only return comments that are visible on the active domain, and then this issue goes away, since the links do not need to be rewritten.

agentrickard’s picture

Domain Source, by the way, integrates with Domain Content to allow batch assignment of source domains.

derjochenmeyer’s picture

thanks for the detailed answers!!! Ill test what works for me.

Right now my parent nodes are only published to one domain.

agentrickard’s picture

Something occurs to me that might also work. If you have strict SEO turned off, in your block, try this.

global $conf;

// Turn on SEO for these links
$conf['domain_seo'] = TRUE;

$query= db_query("SELECT n.nid, n.title, c.uid, c.cid, c.subject, c.timestamp FROM {node} n INNER JOIN {comments} c ON c.nid = n.nid WHERE n.status = 1 LIMIT 10");
$output = '';
while ($comment = db_fetch_object($query)) {
  $title = l($comment->subject, "node/".$comment->nid);
  $output .= $title . '<br />';
}
print $output;

// Turn SEO back off.
$conf['domain_seo'] = FALSE;

In theory, this would temporarily enable domain rewrite rules inside you block.

agentrickard’s picture

Status: Active » Closed (fixed)
summit’s picture

Bookmarking, greetings, Martijn