Skip to content
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

Chat are empty #6

Open
spcyurie opened this issue Apr 17, 2023 · 9 comments
Open

Chat are empty #6

spcyurie opened this issue Apr 17, 2023 · 9 comments

Comments

@spcyurie
Copy link

image

@LeeGoTech
Copy link

Same. I'm experiencing the same issue.

@LeeGoTech
Copy link

Please fix @Hostname47

@Hostname47
Copy link
Owner

@spcyurie , @DanTech2002 Sorry for late response,
Have you checked the database after sending the message, everything is working on my end. I don't know why you get blank, I need to know what you changed in the code and the version of PHP you're using and other stuff.
Please try to use the same PHP version and migrate the database and follow every step in the video and everything will be working

@LeeGoTech
Copy link

I didn't change any code. If that's the case, may I know the version of PHP and XAMPP you are using?

Untitled
untitled1

@LeeGoTech
Copy link

LeeGoTech commented May 8, 2023

I tried on PHP 7.4.33. I got this error, but the database is working fine now. @Hostname47

4

5

@Hostname47
Copy link
Owner

The version of PHP used in this project is 7.4, XAMPP version does not matter, as long as the apache server is running, the problem is not from the server software.

Now that the database is filled, you can investigate the layout/chat/ChatComponent and see why the message is not there, It's a long time ago since I realized this project. Try to echo the message and the parent component until you find the error

@LeeGoTech
Copy link

LeeGoTech commented May 8, 2023

I tried echoing it and here's the error "bool(false) boolean". I'm using the code "var_dump($message); echo gettype($message). Can you fix this for me bro? I can't fix this. I'm new on PHP programming language. @Hostname47

6

@LeeGoTech
Copy link

I tried also on PHP 8.2.

In PHP 8.2, it shows "object(stdClass)#10 (6) { ["id"]=> int(54) ["message_creator"]=> int(1) ["message"]=> NULL ["create_date"]=> string(19) "2023-05-08 23:41:51" ["is_reply"]=> NULL ["reply_to"]=> NULL } object"

but in PHP 7.4, it shows "bool(false) boolean".

@Hostname47
Copy link
Owner

PHP 8 has lot of breaking changes, that's because some things in previous versions are not longer working in newer version.
The problem really is not in message variable, If you go to ChatComponent in layout/chat you'll see in the row 101 that the message is passed as argument to generate_current_user_message function.

Think about that as a requirement: Go to chat page (chat.php) and try to figure out what is wrong there. Because in ChatComponent, it wasn't able to get the message and id, because either the parent object is null or undefined.

I'll try to find some time and check what's wrong, because as far as I can remember, The whole project was working on my side when I was working on it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants