Global Area not being created

Permalink
I have 3 Global Areas in my header.php in my custom theme, two of the areas are successfully being created in the Stacks as Global Areas but the third one is not?

These are the three, the Site Name one is the one which is not being created for some reason?

Any ideas why? I have tried renaming it to something else still with no luck.

<div id="headerLinks">
         <?php 
         $a = new GlobalArea('Header Links');
         $a->display($c);
         ?>
      </div>
      <div id="logo"><?php  
      $a = new GlobalArea('Site Name');
      $a->display($c);
      ?>
        </div>
        <div id="headerNav">
         <?php 
         $a = new GlobalArea('Header Nav');
         $a->display($c);

View Replies:
pvernaglia replied on at Permalink Reply
pvernaglia
Take out the $c in the display line:

<?php
  $a = new GlobalArea('NAME');
  $a->display();
?>
MartinaL replied on at Permalink Reply
I have tried this and it makes no difference unfortunately
mhawke replied on at Permalink Reply
mhawke
Do you get an error message?

It's possible the stacks for the first two Global Areas existed before you added your GlobalArea code in your first post because the code you posted would not create any Global Areas in the stacks because the code has $c in display($c) which is incorrect for Global Areas. You put in the $c for normal areas.
MartinaL replied on at Permalink Reply
I have taken the $c out and it makes no difference it is still not created
MartinaL replied on at Permalink Reply
I saw somewhere someone said to logout and log back and and when u do the Global Areas will 'magically' appear in my Stacks

Well the other 2 did but the site name one didn't

Now when I logout and try and go back to the site I get this error;


Fatal error: Call to a member function overrideCollectionPermissions() on a non-object in /concrete/core/models/permission/assignments/area.php on line 33
mhawke replied on at Permalink Reply
mhawke
Do you have your C5 caching turned OFF?

"Dashboard->Systems and Settings->Cache and Speed Settings"

Turn them all off during development and turn off your browser caching and refresh your pages using CTRL-F5
MartinaL replied on at Permalink Reply
Yes I have caching turned off in concrete5, I also always have caching turned off in my browser by default
mhawke replied on at Permalink Reply
mhawke
My new Global Areas are created as soon as I visit the page that contains the Global Area. I never have to log out and back in again. This is odd. Can you attach your php file to this forum so we can have a look? You'll need to change the .php to .txt to post it.
MartinaL replied on at Permalink Reply 1 Attachment
Sure, header.php (as header.txt) is now attached
mhawke replied on at Permalink Reply
mhawke
Sorry, I didn't see your error message above when I suggested posting your template file. It looks clean.

Are you able to log into your site? If not you might have to temporarily remove the code that calls the Global Areas. Once back in, visit 'Dashboard->Stacks' and check the permissions on those stacks. The error seems to be a permissions thing.
MartinaL replied on at Permalink Reply
Ok you won't believe this but, I had already tried removing $c from just the Site Name call, it didn't work

I have now cleaned up the code for consistency and removed $c from all three of the Global Area declarations (even though the other two worked for some reason)

And now 2 Site Name stacks have been created in Global Areas -- at least it is there now I guess, bizarre though!

But, when I now go to the site itself and go into edit mode on say the homepage and try and add the stack to the Site Name area on the page i get this error;

This is a global area. Content added here will be visible on every page that contains this area.

An unexpected error occurred.
Unable to get permission key for add_stacks
MartinaL replied on at Permalink Reply
I have checked the permissions as suggested and both Add Stacks and Add Blocks is set to adminsitrators, which I am

I can login if I go directly to the login page I just can't get to the site when not logged in now
mhawke replied on at Permalink Reply
mhawke
Try deleting both 'Site Name' stacks from 'Dashboard->Stacks' and let the system create them again when you visit the page. Then go back to 'Dashboard->Stacks' and add the HTML block to it and start over.
MartinaL replied on at Permalink Reply
Also, now every time I log out and log back in a second Site Name Global Area gets created. Each time I delete one and if I log back in again it pops back again and there are two.

I have search all of the code in my custom template and there only appears to be one call to the Site Name global area declaration?
mhawke replied on at Permalink Reply
mhawke
Delete them both.
MartinaL replied on at Permalink Reply
Ok, just tried deleting them both

Logged out and back in and 1 appeared, I added my image block back into it and approved the changes

Now I have gone to the homepage and edited the page and tried to add the stack to the Site Name global area (as it is not displaying in there) and I get this error;

An unexpected error occurred.
Unable to get permission key for add_stacks

I logged out and went to the site, and I still get this error;

Fatal error: Call to a member function overrideCollectionPermissions() on a non-object in /concrete/core/models/permission/assignments/area.php on line 33

When I go directly to the login page and login and go back to Stacks there is only 1 now but I still have all of the other above problems
mhawke replied on at Permalink Reply
mhawke
Unfortunately my wife is waiting in the car to go out for dinner. Try going to "Dashboard->Full Sitemap->Options->Show System Pages" and click on Trash and delete the trash. Perhaps something is in there causing trouble.
MartinaL replied on at Permalink Reply
Ok so I haven't made any progress with this since my last update, does anyone have any idea's what may be causing this issue with this specific Global Area and the error messages I am getting?
MartinaL replied on at Permalink Reply
Also, it is still creating another Site Name Global area each time I log out and log back in, now I have three!
mhawke replied on at Permalink Reply
mhawke
Try Changing 'Site Name' in your GlobalArea call to something else like "My Site Name". Perhaps "Site Name" is a 'reserve word' that the system uses.
JohntheFish replied on at Permalink Reply
JohntheFish
Site Name is not reserved, but like any of the other standard area names should only be used in the semantic equivalent of its default use.