Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Error Editing Links

Quote Reply
Error Editing Links
Andy, wonder if you can shed any light on this ....

I can add links with no problem. And I can edit (modify) a link no problem -- one time only. When I try to edit a link that has been modified once I get this error message ...

An Error has occurred.


Unable to modify link: + The record you are attempting to modify has changed since you last accessed it.

This is appears to be true for categories as well as links.

So, the only thing we can do is to delete the link and put it back.

Have you by chance seen this? Any ideas?

Ron
Quote Reply
Re: [aimcmc] Error Editing Links In reply to
Hi,

Are you using jump.cgi to send people to the links? If so, this causes the timestamp to change, and will give you that error message.

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Error Editing Links In reply to
Not using jump.cgi that I know of. We manually enter and mod all links ourselves. We don't have any users. So all entries and edits are done though Admin

This issue occurs ...

1) Admin

2) Browse

3) Find any link

4) Edit

5) Modify link

get message: Link modified successfully. And it appears it has been changed, but when I select Edit again, the changes have not been changed, although under under the links listing the title field display they have been changed, but upon selecting Edit again, it has has not been changed. Note: the dynamic and built static screens HAVE been changed.


6) Edit again (see edit has not been changed from prior edit)

7) Select Modify link

GET ERROR MESSAGE

---------for categories

1) Admin

2) Browse

3) Select Category

4) Edit Category -

get message: "category" has been successfully modified. And it appears it has been changed, but when I select Edit again, has not changed, although under the Browse Category, it has been changed. Note: the dynamic and built static screens HAVE been changed.

5) Edit Category again ... Get Error message.

-----------------
IN SUMMARY -- Any edit, although appears to have been edited, is only edited partially. The edited fields have not changed although in various other places they have been changed. The dynamic and the built static changes HAVE BEEN MADE. It's like the edit is only being completed halfway and not completely finished on the edit screen itself, and can't be edited the 2nd time.

By the way, this occurs on 3 different and separate sites.

Strange but true!

Thanks for any idea,

Ron
Quote Reply
Re: [aimcmc] Error Editing Links In reply to
Not sure if this is the right track but as far as I can remember there is an issue with validating changes before doing changes again.
Depends on the level where you did the initial edit - also only as far as I remember.
Have you checked if Database -> Validate Changes in the admin?

Regards

Niko
Quote Reply
Re: [el noe] Error Editing Links In reply to
Niko,

Never had to validate before, though it sounds logical. Not sure where to check for Validate Changes in admin. Never did that before, I'll look into it. Thanks for the lead. I'll feedback what I learn. Thank you.
Quote Reply
Re: [aimcmc] Error Editing Links In reply to
Hi,

Are you using page.cgi to show the pages? (even with mod_rewrite). From memory, the "Hits" column gets updated when you get a detailed page view, which will cause the timestamp to update as well.

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!

Last edited by:

Andy: Aug 30, 2021, 10:12 PM
Quote Reply
Re: [Andy] Error Editing Links In reply to
In this case with this problem, I do everything in the admin. So I'm guessing page.cgi has nothing to do with it (?).

1) Never use to have this problem. I "think" it began after I did the update you provided me, which fixed the internal server error. But I can't promise or be sure the update anything to do with it. A lot of technology, including server updates, php, and all that stuff, over the past few years. So I guess it could have been anytime it started.

2) I did find one more thing, it appears that if I wait a day, I it starts over and I again an do an edit that I could not due yesterday, and then it starts all over again. Doing more testing today, and I'll see what pops up tomorrow.

Thank you, -Ron
Quote Reply
Re: [el noe] Error Editing Links In reply to
Check out Validate Changes as you suggested, it says...

"This allows you to validate changes that users have requested."


I'm doing all these edits through the admin without any user involvement, so there is no changes to validate. So it doesn't appear that's a solution.


Thank you,


-Ron
Quote Reply
Re: [aimcmc] Error Editing Links In reply to
Hi,

I would try disabling all your plugins to rule that out. The easiest way is to :

1) Backup /admin/Plugins/plugins.cfg
2) Now in the "Plugins" section of the CP, go through and "edit" each one - unticking the hooks

If it still does the same after this, then it won't be a plugin causing it (you can juust restore your plugins.cfg file to put it back to how it was :)).

The next step would be to enable debugging (Setup > Misc Options), and track the SQL queries etc being run when you do an update. There will be a "Timestmp" field update somewhere before the main update.

I would offer to go in and have a look for you, but it could be quite time consuming to debug - and I'm a bit limited on time these days .

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [aimcmc] Error Editing Links In reply to
Something new ....

I do an edit, try to edit it a 2nd time and get the error message...

BUT if I do the edit, and copy or move it to another category, I CAN again edit it again one time. Only one time.

THEN if I copy or move it again to another new category, I can then edit it again, one more time.

As long as I move it to a new category, I can edit it once.

BUT if I try to move it back to any category it was already moved from, I CAN NOT Modify it again.

It's easy to see when I can modify it now or not, cause whenever I look at the edit screen, I can see if the data is old data or new edited data, and depending on if it is a newly moved to category, or a prior category, that data will either be old or new. Depending on the situation, it's either modifiable once or not.

Strange stuff. I wait tomorrow to see if all of it is modifiable again. I think it all will be.

Ron
Quote Reply
Re: [Andy] Error Editing Links In reply to
Andy, I'll try the plugin thing.

I realize this would be a time consuming troubleshoot venture and surely don't expect you to invest your valuable time. I surely get it.

I've not ever used the debugging before. I'll check it out and see if I can track it down. Honestly I didn't even know it was a feature. I'll give a whirl.

In any case, if in the end, I can make one mod, and if it's necessary to make a 2nd, I can wait 24 hours to do it again. I guess the key is being very careful the first update in the first place.

I don't expect that we'll ever make these users entries again, so I think we will be able to live with it as long as we are careful.

Thank you, -Ron
Quote Reply
Re: [aimcmc] Error Editing Links In reply to
Very odd. Do you run Build All / Changed on a nightly cron? Try running "Build Changed" now if you do. That'll get rid of the error so you can test again (the "has changed since you last modified it" error message is basically telling you the timestamp is different to what was stored)

If you REALLY don't care about that feature - you can just edit it out of /admin/GT/SQL/Table.pm. Find this bit:

Code:
$COMPILE{_check_timestamp} = __LINE__ . <<'END_OF_SUB';
sub _check_timestamp {
# -------------------------------------------------------------------
# Won't modify a record if the passed in timestamp is older than
# what's in the database.
#
my ($self, $keys, $set) = @_;

# first check to see if we even need to look up the orig timestamp.
my $auto = $self->time_check;
return 1 unless ($auto);
my $found = 0;
for (keys %$auto) {
exists $set->{$_} and ($found = 1); # should only be one timestamp.
}
return 1 unless ($found);

# if we got here, then we do a search on the record and compare timestamp.
my $pk = $self->{schema}->{pk};
my $cond = GT::SQL::Condition->new;
my @res;
for my $key (@$pk) {
$cond->add($key, "=", $keys->{$key});
}
for my $tmstmp (keys %$auto) {
push @res, $tmstmp;
$cond->add($tmstmp, ">", $set->{$tmstmp});
delete $set->{$tmstmp};
}
my $sth = $self->select($cond, \@res) or return;
if ($sth->fetchrow_arrayref) {
return $self->warn('ALREADYCHANGED');
}
else {
return 1;
}
}
END_OF_SUB

..and change to simply:

Code:
$COMPILE{_check_timestamp} = __LINE__ . <<'END_OF_SUB';
sub _check_timestamp {
# -------------------------------------------------------------------
# Won't modify a record if the passed in timestamp is older than
# what's in the database.
#
my ($self, $keys, $set) = @_;

return 1;
}
END_OF_SUB


Obviously make a backup of that file, just in case it doesn't work =)

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Error Editing Links In reply to
I only do Build All / Changed when I make changes. I don't cron, just do it manually when necessary. Many days, weeks or months we don't make any changes or additions. So we only Build when needed.

BUT - now catch this, all the testing edits I made an hour or so ago, when I came back in, they were all editable again. Of course, when I edited, I could not edit again.

Not sure, maybe I'm seeing things or I've got digital ghosts. I'm going to give it an hour or two and try gain. This really is a mystery.

I just tried Build Change - the errors still remain.


By the way, when I Build all the edits are properly built. It's only the "edit" screen that is a problem.

Ron
Quote Reply
Re: [aimcmc] Error Editing Links In reply to
Well, I left and came back in an hour. It's magic, now I can edit again (once).

So I just hung out for 15 minutes, and more magic, now I can edit again (once).

Next I'll test to see exactly how long it takes before I can edit or not..

So, it appears for some reason the timestamp for the edit screen is some period of time. I assume it must have something to do with the db server. But it's strange the only time I've found the problem so far is for the edit screen.

-Ron
Quote Reply
Re: [aimcmc] Error Editing Links In reply to
Mabey there is something about the hidden timestamp and the stored value.
Could you check the HTML source of your form and look for the hidden input field 'Timestmp' and after saving the record check what is stored in your database?
And even after that what value is in your hidden field for the second edit.
As Andy dug out there should be a comparison of the saved timestamp and the actual timestamp and it looks like there is a glitch.

Regards

Niko
Quote Reply
Re: [el noe] Error Editing Links In reply to
I seem to remember I once had an issue with "build changed", where it wasn't building changed links. It turned out to be a mySQL setting for the timezone (it was set to 1 hour ahead). Pretty sure thats not the case here, but who knows!

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Error Editing Links In reply to
Sorry for the delay in getting back to ya all. Not enough time in a day to get it all done. Anyway, you will remember that once I make an edit, the 2nd edit causes the error message. Finally, I learned, that if I wait about ten minutes, the 2nd edit is accomplished with no error. Then, I have to wait an additional ten minutes to make any further edit. It appears to be fairly consistent. As long as I wait at least ten minutes, I have no edit problems. Strange but true! Thanks much for all your help. -Ron
Quote Reply
Re: [aimcmc] Error Editing Links In reply to
If that were me, I would just do this tweak I suggested:

https://www.gossamer-threads.com/...nks_P317885/#p317885

No faffing about waiting 10 mins between changes then ;)

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Error Editing Links In reply to
Thank you Andy. I will surely give it a whirl. I appreciate and respect your knowledge. Thank you again. -Ron