Author |
Message |
Palbin
Site Admin

Joined: Mar 30, 2006
Posts: 2583
Location: Pittsburgh, Pennsylvania
|
Posted:
Wed Oct 29, 2008 7:10 pm |
|
When trying to use the "show" function in the blocks admin it just redirects to index.php. Note this just happens when using the RavenIce theme.
After some testing I figured out it is because BLOCK_FILE is undefined. It seems that what ever module/admin area you are in BLOCK_FILE is undefined. So there for the security check at the top of each block will kick you to the index. If you switch to any of the other stock themes BLOCK_FILE is magicly redefined. Obviously this is a theme issue, but after looking at it for severl hours I am unable to figure out why.
I know I could fix this by insertig another define for BLOCK_FILE, but I would think that is not the best solution. |
|
|
|
 |
jestrella
Moderator

Joined: Dec 01, 2005
Posts: 593
Location: Santiago, Dominican Republic
|
Posted:
Wed Oct 29, 2008 8:21 pm |
|
Does this happen with every block you try to show on admin panel when using RavenIce theme???? |
_________________ "For those whom have not reach the sky... Every mountain seems high"
Best Regards
Jonathan Estrella
http://about.me/jestrella04 |
|
|
 |
Palbin

|
Posted:
Wed Oct 29, 2008 9:02 pm |
|
Yes because BLOCK_FILE is undefined so the check at the top of each block file fails and you are redirected to index.php. |
|
|
|
 |
jestrella

|
Posted:
Wed Oct 29, 2008 9:31 pm |
|
Ok I was able to replicate your issue. And here's a temp fix:
open up file /admin/modules/blocks.php and find at line 360 (assuming virgin code)
Code:function block_show($bid) {
|
after that add...
Code:if(!defined('BLOCK_FILE')) {define('BLOCK_FILE', true);}
|
So it end up like this...
Code:function block_show($bid) {
if(!defined('BLOCK_FILE')) {define('BLOCK_FILE', true);}
global $prefix, $db, $admin_file;
|
|
|
|
|
 |
Palbin

|
Posted:
Wed Oct 29, 2008 9:36 pm |
|
Yeah that is basicly what I did to make it work also, but obviously not the best.  |
|
|
|
 |
jestrella

|
Posted:
Wed Oct 29, 2008 9:40 pm |
|
I will take a deeper shot at this... will keep you informed |
|
|
|
 |
jestrella

|
Posted:
Wed Oct 29, 2008 10:03 pm |
|
Well, I think this is related to how the theme render the blocks. As I can see there no blocks shown when the admin's block_show() function takes place (when using RavenIce theme). In others themes if the right blocks are loaded first then this will show up with no issue.
Thoughts???? |
|
|
|
 |
Guardian2003
Site Admin

Joined: Aug 28, 2003
Posts: 6799
Location: Ha Noi, Viet Nam
|
Posted:
Wed Oct 29, 2008 10:31 pm |
|
Fix seems good to me.
jestrella - can you create a Mantis issue for this (RN2.3.01) ? |
|
|
|
 |
jestrella

|
Posted:
Wed Oct 29, 2008 10:33 pm |
|
|
|
 |
Raven
Site Admin/Owner

Joined: Aug 27, 2002
Posts: 17088
|
Posted:
Fri Nov 28, 2008 5:46 pm |
|
This is a result of RavenIce incorporating this logic: $hide_blocks_left = array();
The logic that is used to implement this feature no longer uses the blocks('left'); call in function themeheader(). Even more bewildering is the fact that the code if(!defined('BLOCK_FILE')) {define('BLOCK_FILE', true);} was in the 2.20.01 release but somewhere along the line got "lost" so adding it back in makes perfect sense. |
|
|
|
 |
CodyG
Life Cycles Becoming CPU Cycles

Joined: Jan 02, 2003
Posts: 714
Location: Vancouver Island
|
Posted:
Wed Dec 17, 2008 7:12 am |
|
I'm not sure if this is the same issue...
My right side blocks are working fine if they are defined for Registered Users.
When I try to set a block for All Visitors, then the blocks fail and don't show for Anonymous, only after logging in do they show up.
I'm using a custom 'Join Form' module, which becomes the index.php for my not logged in users. They get no right side blocks no matter what theme I have set as default.
I tried the above fix. It didnt' work for me.
Is there something I need to add to the module index.php?? Or is there something missing in my custom block files? I have this at the beginning...
Code:
if ( !defined('BLOCK_FILE') ) {
Header("Location: ../index.php");
die();
}
|
Perhaps that Location:../index.php ??? which is refers to the root index.php?? And as the index.php that anonymous sees is not in the root ????? |
_________________ "We want to see if life is ubiquitous." D.Goldin |
|
|
 |
|