When clicking on the edit icon (pencil) of a node, the page not found indication is given.
(editing via the tab does work)

url when using the icon
http://www.xxxxxxxxxx.be/drupal-6.2/node/1/edit

url when using edit-tab
http://www.xxxxxxxxxx.be/drupal-6.2/?q=node/1/edit

It looks like the ?q= is missing.

Comments

stattler’s picture

Your site itself shows page load error in FF. The mentioned errors are not occurring with me at www.stattalk.org

trombone’s picture

1. The xxxxxxxxxx is just an example, not the real site-name.

2. You are using clean-url's on your site. Maybe then the problem does not appear ???

stattler’s picture

ops! I thought that is the real site.
Ya, I am using clean URL but I've tested disabling clear URL and I found no problem. I can edit by clicking on the pencil button with clear URL disabled.

hswong3i’s picture

Seems the problem is due to the following PHP:

<?php if (node_access('update', $node)): ?><a href="<?php print check_url(base_path()) ?>node/<?php print $node->nid ?>/edit" class="editlink" title="<?php print t('Edit') ?>"> </a><?php endif; ?>

As you can see that the link is printed as <?php print check_url(base_path()) ?>node.... directly, it will always missing the ?q= prefix.

I give a quick review about how admin/settings/site-information handle this change, and they did it as:

'#field_prefix' => url(NULL, array('absolute' => TRUE)) . (variable_get('clean_url', 0) ? '' : '?q='),

I will clone this handling within latest -dev packages. Anyway, good catch ;-)

P.S. as a quick solution, check if your Apache's mod_rewrite is active and functioning from admin/settings/clean-urls. The pencil link will always function if your site is ABLE to work with mod_rewrite (so the case of my site, and also that of stattalk's)

hswong3i’s picture

Version: 6.x-1.0-rc1 » 6.x-1.x-dev
Assigned: Unassigned » hswong3i
Status: Active » Fixed

Already fix within latest CVS HEAD. D5 version is tested as safe so no change is required. Other 3 related themes (Contented7, Internet Services and Interactive Media) are updated, too

thePanz’s picture

I'd like to use a clean solution, using Drupal function to get original links:

 if ($node->picture)
   print theme('user_picture' , $node);
 
 if (node_access('update', $node))
      print l(t('Edit'), 'node/'. $node->nid .'/edit', array('attributes' => array('class' => 'editlink', 'title' => t('Edit'))));

this code, with some CSS edits added to ".meta .editlink" selector

text-indent: 99px;
overflow: hidden;

you get a clean, semantic and validated node editing link

Regards

thePanz’s picture

Status: Fixed » Needs review
hswong3i’s picture

Status: Needs review » Fixed

@thePanz: I don't remember the reason of changing from l() to url() so clearly; but according to my memory, it is all due to the change of Drupal core coding style.

As I keep on hacking Drupal core with Oracle few months ago, I keep trace on EVERY core CVS commit. I found that Drupal core is change from using l() to url() in D6, heavily. According to my understanding, it is all due to performance concern: l() is a wrapper function of url(), and so extra checking will be preform. If we are able to predict the final result of l(), e.g. node/$nid/edit is always exists, just use url() directly may able to provide some performance boost up.

The change of pencil link implementation since Contented7 6.x-2.0-RC1 (the CHANGELOG.txt and the node.tpl.php CVS diff): even not exactly using url() at that moment, the above idea should also apply to this change (well... and finally it is buggy, therefore we have this bug report issue...).

Your suggested implementation is similar as that of D5 node.tpl.php, with a some transformation. BTW, based on the above reason, I am not going to re-roll the old style, if the new implementation is functioning.

Moreover, it is not too meaningful for printing out real text as "Edit" but finally hidden it with CSS, if a link with space only is also valid. The main point of this pencil link bottom is trying to provide a fancy and handy hack for site administrator, but not means its implementation need to be very fancy :-)

Anonymous’s picture

Status: Fixed » Closed (fixed)

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