New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing page_id in database #4520

Closed
wintstar opened this Issue Jan 28, 2018 · 27 comments

Comments

Projects
None yet
5 participants
@wintstar

wintstar commented Jan 28, 2018

Version Information:
Forum version: SMF 2.1 Beta 4 (more detailed)
Current SMF version: SMF 2.1 Beta 3
GD version: bundled (2.1.0 compatible)
MySQLi engine: MySQL
MySQLi version: 5.6.26
Alternative PHP Cache: 5.1.2
PHP: 7.1.10 (more detailed)
Server version: Apache/2.4.28 (Win32) OpenSSL/1.0.2l PHP/7.1.10

New install with Pull Request #4513

As I have already reported in Issue #4496 there is a problem with the page navigation.

Franky Yesterday at 23:52 ::1 2fba1acc8a75b7daa495be041cd4a724 Type of error: CriticalThe database value you're trying to insert does not exist: page_idFunction: Displayhttp://localhost/smfbeta/index.php?topic=4.50File: C:/xampp/htdocs/smfbeta/Sources/Display.phpLine: 917  
Franky Yesterday at 23:52 ::1 2fba1acc8a75b7daa495be041cd4a724 Type of error: CriticalThe database value you're trying to insert does not exist: page_idFunction: Displayhttp://localhost/smfbeta/index.php?topic=4.0File: C:/xampp/htdocs/smfbeta/Sources/Display.phpLine: 917  
Franky Yesterday at 23:51 ::1 2fba1acc8a75b7daa495be041cd4a724 Type of error: Undefined8: Undefined offset: 0http://localhost/smfbeta/index.php?topic=4.50File: C:/xampp/htdocs/smfbeta/Sources/Display.phpLine: 1003

If I see the right thing to do, will be in the Display.php is specified in line 917
https://github.com/SimpleMachines/SMF2.1/blob/release-2.1/Sources/Display.php#L905-L920

to request the Saisson ID of the page

SMF2.1/Sources/Display.php

Lines 848 to 876 in de7e49f

if (isset($_SESSION['page_topic']) && $_SESSION['page_topic'] == $topic)
{
// User moved to the next page
if (isset($_SESSION['page_next_start']) && $_SESSION['page_next_start'] == $start)
{
$start_char = 'M';
$page_id = $_SESSION['page_last_id'];
}
// User moved to the previous page
elseif (isset($_SESSION['page_before_start']) && $_SESSION['page_before_start'] == $start)
{
$start_char = 'L';
$page_id = $_SESSION['page_first_id'];
}
// User refreshed the current page
elseif (isset($_SESSION['page_current_start']) && $_SESSION['page_current_start'] == $start)
{
$start_char = 'C';
$page_id = $_SESSION['page_first_id'];
}
}
// Special case start page
elseif ($start == 0)
{
$start_char = 'C';
$page_id = $context['topicinfo']['id_first_msg'];
}
else
$start_char = null;
in the database. But I don't find this column in the *_messages table.

missing_page-id

Also in the database script I don't find page_id, not even in the upgrader
https://github.com/SimpleMachines/SMF2.1/blob/release-2.1/other/install_2-1_mysql.sql#L775

https://github.com/SimpleMachines/SMF2.1/blob/release-2.1/other/install_2-1_postgresql.sql#L1172

I have done a new installation several times and also searched here for page_id

https://github.com/SimpleMachines/SMF2.1/search?utf8=%E2%9C%93&q=page_id&type=

So I apologize in advance if I'm wrong with my research for the mistake.

@albertlast

This comment has been minimized.

Collaborator

albertlast commented Jan 29, 2018

The error doesn't mean that the collumn is missing,
what the message try to say is that $page_id is defined to use but empty:
https://github.com/SimpleMachines/SMF2.1/blob/release-2.1/Sources/Display.php#L917

Can you describe more deeply what your steps are?
I'm not able to reproduce this error.
Did you got this error also in your new installation?
And a var_dump($start_char); in line 902 in Display.php would be nice to know in which "mode" your create this error message.

@Sesquipedalian

This comment has been minimized.

Member

Sesquipedalian commented Jan 29, 2018

My guess is that if you change the condition here to if (isset($start_char) && isset($page_id)), that would solve the problem, @albertlast. But like you, I am very curious to know how @wintstar managed to trigger this error and what that var_dump($start_char); will produce.

@albertlast

This comment has been minimized.

Collaborator

albertlast commented Jan 29, 2018

Yeah i know that the easy solution exists,
but i want to know the issue.

@Sesquipedalian

This comment has been minimized.

Member

Sesquipedalian commented Jan 29, 2018

Yes, me too. I'm quite curious about it.

@wintstar

This comment has been minimized.

wintstar commented Jan 29, 2018

I've already tried to explain it in this issue #4496 . I had written an post about the last changes to a pull request. When I had sent this off, I didn't return to this written post. When I then click on the last post in the forum overview in the Recent Posts block, I come to the last post on the previous page of the topic. If I then delete the cache in the forum, browser the cache and the cookies in the browser it works some times that I get come to this post. This error occurred only after the last pull request, starting from the 17.01.2018.

@albertlast

This comment has been minimized.

Collaborator

albertlast commented Jan 29, 2018

To be ownest i don't understand you description.
Some one of the smf team mention as solution,
that you could describe the steps in german in a topic on sm.org (german area).
So that we keep albe to reproduce the error.

@wintstar

This comment has been minimized.

wintstar commented Jan 29, 2018

Ich habe einen Beitrag erstellt. Dannach gelangte ich nicht zu diesem Beitrag, sondern zum letzten Beitrag auf der vorherigen Seite. Dann versuchte ich im Block Aktuelle Beiträge durch Klicken auf den letzten Beitrag zu diesem zu gelangen. Aber ich kam wieder nur zum letzten Beitrag der vorherigen Seite. Nachdem ich im Forum und Browser den Cache und die Cookies gelöscht habe, konnte ich ein paar mal zum letzten Beitrag gelangen. Nach einer Zeit später (dauerhaft angemeldet) habe ich auf den letzten Beitrag geklickt, kam aber wieder nur zum letzten Beitrag der vorherigen Seite. Und es erschien wieder eine Fehlermeldung. Bei einer Neuinstallation ohne Themen und Beiträge erscheint der Fehler nicht.
Das Thema hat 50 Antworten und es ist in den Einstellungen Admin / Profil festgelegt:

Profil
Themen, die pro Seite angezeigt werden sollen: 50
Beiträge, die pro Seite angezeigt werden sollen: 50
Zeige möglichst neue Beiträge oben in der Themen Übersicht: Ja

Admin
Limitierung der angezeigten verknüpften Seiten Zusammenhängende Seiten, die angezeigt werden sollen: ja
"3" anzeigen: 1 ... 4 [5] 6 ... 9 "5" anzeigen: 1 ... 3 4 [5] 6 7 ... 9 : 5
Anzahl der Themen pro Seite in der Beitrags Übersicht: 20
Anzahl der Beiträge pro Seite in einer Themenseite: 15

@albertlast

This comment has been minimized.

Collaborator

albertlast commented Jan 29, 2018

Über quickreplay den beitrag erstellt oder ganz normal über post?

@wintstar

This comment has been minimized.

wintstar commented Jan 29, 2018

Normal, kein Quickreplay

@wintstar

This comment has been minimized.

wintstar commented Jan 29, 2018

Das merkwürdige ist, ist mir beim Schreiben aufgefallen, dass die Seiten Einstellungen im Profil nicht funktionieren.

@albertlast

This comment has been minimized.

Collaborator

albertlast commented Jan 29, 2018

Kannst du den fehler in einer sauberen installation wieder holen?
und kannst du den fehler in deiner jetzigen reproduzieren?

@wintstar

This comment has been minimized.

wintstar commented Jan 29, 2018

Habe ich gemacht. Wie ich oben geschrieben habe, bei frischer Installation alles ok. Aber wenn´Boards und Themen mit Antworten hinzukommen, kommt der Fehler.

@albertlast

This comment has been minimized.

Collaborator

albertlast commented Jan 29, 2018

The setting of "Show most recent posts at the top in topic view." in the profile setting could be the root cause,
i will look into this.

@wintstar

This comment has been minimized.

wintstar commented Jan 29, 2018

Ok, auch meine Vermutung.

@albertlast

This comment has been minimized.

Collaborator

albertlast commented Jan 29, 2018

Please try the fix from pr #4522
you need a clean state,
way how you get this:
open a topic than go back and open a different topic = clean state.

@wintstar

This comment has been minimized.

wintstar commented Jan 29, 2018

Fix durchgeführt. Seiten Anzeige Einstellung funktioniert nicht. Es scheint auch ein Fehler im Aktuellen Beiträge Block zu sein. Der zuletzt gepostete Beitrag erscheint dort nicht. Ganz oben ist nur der vorletzte.

recent_block

@albertlast

This comment has been minimized.

Collaborator

albertlast commented Jan 29, 2018

Looks like a different issue,
which need to fix also.
But the first issue is fixed right?

@wintstar

This comment has been minimized.

wintstar commented Jan 29, 2018

Nein. Die Seitenazahl entspricht nicht den Einstellungen im Profil. Und ich kommen nicht zum letzten Beitrag. Auch nicht mit dem Link mit dem grünen Pfeil wie oben im Screenshot. Immer auf den letzten Beitrag der vorletzten Seite. Es muss im Zusammenhang sein, mit den Pull Requests nachdem 17.01.2018 sein. Vorher war alles in Ordnung. Vermutlich dieser #4484 Bzw. Diese Änderungen mit den Cookies.

@albertlast

This comment has been minimized.

Collaborator

albertlast commented Jan 29, 2018

That the id are different looks right,
but i notice a issue which could lead also to your bug.
So please try the updated pr.

You need again get sure that you got a clean state.

@wintstar

This comment has been minimized.

wintstar commented Jan 29, 2018

Kleinen Moment bitte, ich rekonstruiere gerade mit welchem Pull Request der Fehler kam.

@albertlast

This comment has been minimized.

Collaborator

albertlast commented Jan 29, 2018

The issue came with the implementation of my seeking pr.
I didn't know that the feature exists where you can change the sort of the topic.

@wintstar

This comment has been minimized.

wintstar commented Jan 29, 2018

Ok, dann teste ich die neue Änderung. Moment.

@wintstar

This comment has been minimized.

wintstar commented Jan 29, 2018

#4522
Works. Also with the topics urls at the screenshot of the top.

@Gwenwyfar Gwenwyfar added the Topics label Jan 29, 2018

@illori

This comment has been minimized.

Contributor

illori commented Jan 30, 2018

please reply in english so we can all understand what you are posting.

@wintstar

This comment has been minimized.

wintstar commented Jan 30, 2018

@illori

#4520 (comment)

Why don't you use Deepl, too?
On request I also answer in German!

@illori

This comment has been minimized.

Contributor

illori commented Jan 30, 2018

@Sesquipedalian

This comment has been minimized.

Member

Sesquipedalian commented Jan 30, 2018

In general, sure, answering in English makes it easier for most of us to understand. But in this case English was preventing rather than assisting communication. @albertlast explained in English the results of his conversation with @wintstar so that the rest of us could understand what was going on. If someone wants more details, translate.google.com isn't difficult to use.

So to my mind, everything that happened in this discussion went exactly the way it should have. Thanks again, @wintstar, for the bug report, and thanks to @albertlast for taking point on discussing it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment