Drupal 7. Server sending tpl before main site html - drupal

When clicking on a specific menu button the server sends out the contents of a tpl file first before sending the primary HTML. This renders the <div... above the <html... breaking the site.
This only happens when I clear the cache and first visit to the relevant page. If I refresh the page the site works as it should. Further visits work as well. Its just the initial visit after a cache flush this happens.
Any ideas?

Found a rogue
print($menu)
Sorted

Related

Why does server show old ASPX page (even if deleted)?

When I upload a new .aspx file, the server continues showing the old version.
What I've tried:
Forced page refresh: Control+R or Control+F5
Deleted the file on the
server & refreshed page.
Expected result: new page shown (or 404 error when page deleted)
Actual result: old page dhown.
Repro steps:
View https://www.bungalowsoftware.com/subscription/info/default.aspx
The START NOW button shows a link to .../create.aspx
View in File Manager and that button shows link to /buy
RENAME$ /default.aspx to something else (default.disabled.aspx, etc.)
Browse to the site again. Should give a 404, but still shows page.
This is happening with every aspx page I've tested.
Note: if I update or add plain .html files* the new versions show up immediately through the browser.
*in the same directory as the .aspx page I'm testing.
To resolve the cache issue you could follow the below steps:
1)Open Internet Information Services (IIS) Manager.
2)In the Connections pane, go to the site for which you want to disable caching.
3)From the middle pane, double-click HTTP Response Headers.
4)In the HTTP Response Headers pane, click Set Common Headers... in the Actions pane.
5)In the Set Common HTTP Response Headers dialog box, check the box to expire Web content, select Immediately, and then click OK.
Note: After making changes to the iis site folders or pages do not forget to restart iis server or site.

can not add an iframe tab

Ok, so I've done it a hundred time or more, but today - got a new problem.
created a simple html page with an image
uploaded to a server
opened the page in the browser - no problem, all works fine.
created a new app, selected "tab" and insert the tab name, the http and https url
Tried to view the app and got "The page you requested was not found"
I've checked with other iframe tabs that I've built, they all configured the same, yet the new one - fails to load.
I've seen that the interface has changed a bit, Its not unusual that Facebook breaks things from time to time but maybe I'm missing something?
Edit: also, from some reason I don't have the "View App Profile Page" on that app
They changed some things around, profile pages are no longer being made. Check this out http://developers.facebook.com/blog/post/611/
Although I'm still having problems with getting errors when I try to add the app

Session variable trounced by Chrome and FF

In my asp.net web application on page load I grab the current page url and store it in a session variable to track which page the user is on so they can return to it if they enter an admin area, do some navigating around etc. They can then click the return button and will be taken to the page they were on before entering the admin.
This all works in IE8; however in FF and Chrome when in the admin the return link redirects to the custom 404 page I have for the web app.
For testing purposes I added the code I wrote below in with my page load event:
Response.Write((string)Session["navurl"]);// displays "http://somedomain.com/customerror/default.aspx"
Session["navurl"] = currentUrl;//ex. currentUrl = "http://somedomain.com/contact/"
Response.Write((string)Session["navurl"]);//ex. currentUrl = "http://somedomain.com/contact/"
Again this works without a problem in IE, but in FF and Chrome on page load the session variable displays the 404 page link and after setting it displays the correct link. I used fiddler to see what was going on and Chrome is throwing a 404 in the GET header for the favicon.ico file, which I am not using in this web app.
I added the faviocon file and the link in the head of the site.master file and Chrome and FF now work fine; I'm still not sure why this is happening. Anyone have an ideas why or how my Session variable is getting overwritten by Chrome or FF?
As a side note I have stepped thru the process debugging and currentUrl is the proper url.
Well, if you are using the .NET handler to serve all pages (ie. all file extensions), then it makes sense that when your browser will make a request for favicon.ico (google to understand what this is), the server fails to find it, and it redirects to a 404. Which in turn modifies the Session variable as "the last page served" : 404.
Now when you render you admin page, and query the Session for "the last page served" what do you get ? "404".
I'd suggest checking the URL to see if it reffers to a user-navigationable page before storing it in session
if (IsAUserPage(currentUrl)
Session["navurl"] = currentUrl;
When you access your admin, are you preserving your session? Using Fiddler have you seen another request for your page? Look for image tags with src="", or iframes.
You must set the Session var on every front end page, but, you never must never set it on the admin pages, only getting to build the "Back" link. If you are using Global.asax events, take care to avoid change the var when serving admin pages.

Drupal 5 and node?destination=node

I've had a drupal 5 site for over 2 years. For some reason my browser dropdown URL retains www.xxx.co.uk/node?destination=node for the site url. This has work until now - when I get
The page isn't redirecting properly
Firefox has detected that the server is redirecting the request for this address in a way that will never complete.
* This problem can sometimes be caused by disabling or refusing to accept
cookies.
typing in the bare url www.xxx.co.uk gives the same results. I'd just modified the site to add another picture gallery. I can access the site by typing in www.xxx.co.uk/node/1 but if I logout I'm back to the above problem, I assume for the same destination=node problem.
Didn't change any modules that I recall. Any ideas?
OK, I can answer this myself after a bit of investigation. I used import images to load my pics. What I failed to notice was that the nodes created by the import were all set to promoted to front page. Remove this from all the image nodes and everything is back to normal. No idea why my browser dropdown retains the url as above.

Even after loging out I can go back to the home page using BACK button!

I am using ASP.net with C#.After I logout its possible to go back to pages using back button.I could fix the prob for the login.I have prob with the logout.I am using the inbuilt login page provided by the asp editor.Should I use sessions?
please help.
This is a caching issue. Browser will be loading the page from cache. You can disable caching of the Home page, and check for user session in that page. By this you can avoid the problem.
See HttpCacheability Enumeration
On all pages in your site, you need to check if the user is still logged in and if not, log them out.
You also need to make sure that the pages are not cached on the browser on anywhere else.
After using the back button, try doing some process that needs login privilages. I think you are logged out already but your browser is displaying your page from the cache.
As #Rahul has identified this is a cacheability issue. Basically what is happening is when the user visits the page the browser is caching it. So regardless if the user is logged in/out, when the user selects the back button, the page being retrieved from the cache not the server.
If you want to ensure the page is always retrieved from the server (which will effectively resolve your issue) you need to set Cacheability to NoCache. See Setting the Cacheability of a Page.
See Login on the Web. The same principles apply.
I used history.forward() in the header of the web page, which I didn't want to be displayed.
It is working.

Resources