The requested topic does not exist error in PHPBB - phpbb

Getting The requested topic does not exist error in PHPBB when posting reply to any forum in PHPBB forum

This issue exists because whenever you will post the reply then your url will have &amp instead of & which is being treated as a seperate variable. So you need to add below code into your viewtopic.php file available in root folder after line number 30 :-
if($topic_id==0)
$topic_id = request_var('amp;t', 0);
if($post_id==0)
$post_id = request_var('amp;p', 0);

Related

Github Enterprise Raw URL Gist Unable to Download

I'm able to get a list of gists and their files https://api.git.mygithub.net/users/myuser/gists?per_page=100&page=1 which I found using the docs here: https://docs.github.com/en/free-pro-team#latest/rest/reference/gists#get-a-gist
The files on the gist object have a raw_url. If I fetch the raw_url with the same token, it fails wanting me to authenticate. If I add the header: Accept: application/vnd.github.v3.raw it returns a 406 Not Acceptable. I've references to that header around.
I'm not sure what the scope should be on the token. It seems like it would be the same one I accessed the API. In the UI if you click the raw file it gets a token appended to the url. That token doesn't look like one of the Private tokens mentioned here: https://docs.github.com/en/free-pro-team#latest/github/authenticating-to-github/creating-a-personal-access-token
So what is the format of the HTTP request to download the raw gist?
The raw url needs to have the hostname of gist. changed to raw. and the url path needs to start with /gist/.
Example code in Go fixing it:
url := gistFile.RawUrl
url = strings.Replace(url, "gist.", "raw.", 1)
url = strings.Replace(url, ".net/", ".net/gist/", 1)

Getting the main url on which error occured in Yii 1

We have implemented an error handler for Yii 1. Also we have implemented the mail functionality with this as any error occurred an email will be send to us but the problem is we are not getting the current URL on which error is generating. Like one page controller/action can contain many images favicons etc. So if any image is missing then we are getting the image URL which showing 404 from:
$url = Yii::app()->createAbsoluteUrl(Yii::app()->request->url);
But we are not getting current URL not even in $error = Yii::app()->errorHandler->error.
So we are not getting the page in which image is absent. Please let me know if is there any way to get current page URL as I have tried many ways but all they are returning the missing images URL instead of main page URL for which images are missing.
createAbsoluteUrl() expects route as first argument - it may return random results if you provide URL instead of route (like in your code snippet).
If you want absolute URL of current request, you may use combination of getUrl() and getHostInfo():
$url = Yii::app()->request->getHostInfo() . Yii::app()->request->getUrl();
In case of error you can get current page url using Yii::app()->request->requestUri in Yii 1.

Podio::authenticate_with_app($app_id, $app_token); is not working

My client has a site on 'ideacontainer.net/real_coffee/'. Now I guess he has accidentally deleted the app then recovered it. But from that time he is not able to access his site.
This is the code in his index file
require_once 'podio-php-master/PodioAPI.php';
$client_id = "some-client-id";
$client_secret = "3zLcr...";
$app_id = "17373109";
$app_token = "48148cfca3c...";
Podio::setup($client_id, $client_secret);
Podio::authenticate_with_app($app_id, $app_token);
When I am commenting it line by line it is working till "Podio::authenticate_with_app($app_id, $app_token);" line. So I think the problem is in this line.
Please let me know the solution.
Thanks
Shashank Kumar
You need to create new client (the one mentioned in your code as client_id), also you will have to re-generate app token and re-check app_id. If it still doesn't work, please provide full error message returned from Podio API.

Create custom Kibana dashboard with custom query

I have 2 log files, 1 for Apache and another for a custom app. To query the logs for errors, the Apache log has log level tag as ERROR while the custom app has a response code tag 500.
I have a dashboard that shows the total errors in Apache log that matches tag = Error and second for total errors that match response code = 500.
My challenge is how to combine both errors as one rather than separating it. I have searched online for documentation on how to define query as global error = total with tag = error in apache log TYPE & total with response = 500 in xxx log type.
Thanks
Assuming you don't want to somehow correlate Apache and application logs but simply want all events that match either condition, i.e. the sum of both types of errors, this works (adjust field names to taste):
(type:apache AND tags:error) OR (type:custom AND response_code:500)

400 error message when trying to create a new document in CouchDb using XMLHttpRequest

I am trying to create a new document in a couchDB database but with the following code I get a '400 bad request' response. I want to create a document that does not contain any other information than the _id (and of course the generated _rev).
var xhrCreate = new XMLHttpRequest();
xhrCreate.open('PUT','http://domainName:5984/dbName/docName/', true);
xhrCreate.setRequestHeader("Content-type", "application/json");
xhrCreate.send();
The CouchDb documentation says that a 400 error indicates a:
"Bad request structure. The error can indicate an error with the request URL, path or headers. Differences in the supplied MD5 hash and content also trigger this error, as this may indicate message corruption."
Could anyone point me in the right direction? Hints and help is much appreciated.
CouchDB requires an empty document as part of the content:
xhrCreate.send('{}');