• Content count

  • Joined

  • Last visited

Community Reputation

2 Neutral

About cosmicsafari

  • Rank
    Jr. Member
  1. Seems like Tom. was correct, the problem wasn't with the admin template after all. I forgot that I had built a module which would limited who could access pages based on the admin template depending on their roles. It appears that in creating the new role it totally messed with the logic of the module, I have since updated the module and I can log back in again as expected.
  2. Luckily there is a front facing log in form, so I managed to add the superuser role to a normal account and log in that way. Will update when I figure out what it was I had changed and how to undo it, figure it might be useful for others in future.
  3. Scratch that I found them under 'field_roles'
  4. Hi All, Which table within the database stores a users assigned roles?
  5. Thanks!
  6. Hi All, I was playing around with the settings for various templates as I had created a new role and have inadvertantly locked myself out. I changed some of the settings on the Admin template, so I assume this is what has caused the lock out. I have direct access to the database but I have no idea what I would need to change in it to regain access. Probably also worth mentioning that all the existing pages are still accessible, but /processwire throws a 404.
  7. Hi all, Just wondering if its safe to delete the content of the cache table manually within the database?
  8. Scratch that turns out I had the 'Deference in API as' set to 'Multiple pages' under the fields Details tab. Figured this might be of use to others so i'll leave this here.
  9. Hi all, I'm just trying to update a custom field value for a page but I noticed in the DB that the old value is still there? Rather than updating, it appears to create a new record for the updated value and increments the sort value. Why is this? Is it not possible to just overwrite the value within the DB using the API? For example: $pageObject->of(false); $pageObject->customField = "Updated Value"; $pageObject->save(); $pageObject->of(true); I would have expected the value just to be overwritten and persisted to the field table in the database? Obviously I am missing something or just not grasping why it works like this?
  10. Hi all, I have created a new admin page which just lists some form submission details, it works as expected so I'm pretty happy with it. The only thing I can't figure out is how to now add a new tab which links to this custom page. From what I have read it seems like most people do this by including it as part of a module, I would like to avoid creating this a page as a module as it is specific to this website and has no reusability. However I am yet to find any documentation stating whether this is even possible without going down the module route. Any help would be much appreciated.
  11. Thats the one, thanks for that.
  12. Hi All, Fairly new to ProcessWire so apologies if this is a daft question, but I am having a go creating my first module. I have set it up and enabled it as per the docs. However I have created another class within the same module directory, which was going to be used in the main module file but I can't get it to work for the life of me and I believe its due to me not fully understanding the namespace side of things. Example: MyModule.module.php <?php namespace ProcessWire; class MyModule extends WireData implements Module { public static function getModuleInfo() { return array( 'title' => 'Test Module', 'version' => 1, 'summary' => 'Test module', 'href' => '', 'singular' => true, 'autoload' => true, 'icon' => 'exchange', ); } public function newMethod( $testMessage ) { $foo = new Foo($testMessage); $foo->getFoo(); } } Foo.php <?php namespace ProcessWire; class Foo { protected $foo; public function __construct($foo) { $this->foo = $foo; } public function getFoo() { return $this->foo; } } Now as I understand it both these files should exist under the ProcessWire namespace, so in theory I should be able to use Foo within MyModule without any use statements as they both exist at the same level within the ProcessWire namespace? However when I try something like so: $myModule = $modules->getModule('MyModule'); $myModule->myMethod('Foo'); I would have thought this should return 'Foo', however I keep running into errors like: Any help would be appreciated.