Hot answers tagged

14

We had one site that had 'lost' all it angular pages, eg CiviMail and System Status. In our case the angular cache files were returning 404 on the New Mailing page. (and 'inspector' was showing a lot of red angular errors) It was building the cache files in sites/default/files/civicrm/images, but then searching for them in sites/default/files/civicrm/...


8

I was able to solve this, at least for now, on my WordPress 4.8/Civi 4.7.22 site using this suggestion from Tim Otten: another work-around should be going to "Administer => System Settings => Debugging" and disabling the "Asset Cache" Of course in the long term we'd like to take advantage of the Asset Cache. But for now at least we have our angular-based ...


6

I've been recently digging into Angularjs, as I'm trying to make some customization, and this is what I figured out after a reading loads of blog posts covering the subject. I'm not an angular expert so I don't know how this affects performance. The following script is from an extension using hook_civicrm_angularModules and Angular's $provide service in ...


4

Disclaimer: I'm not an angularjs expert Again this is a bit of a hack, we are intercepting a built-in CiviCRM angular directive and extending to add behaviour. Create a custom extensions or use an existing one and implement hook_civicrm_angularModules: function myextension_civicrm_angularModules(&$angularModules){ $angularModules['myModule'] = ...


3

Here's one answer that fixed my problem (see my comment above). The cause was that when I created the Drupal system I just used the domain name without the www. But Civi was loaded with www. This is an old problem and I'm a bit ashamed to admit I made this mistake again! But if your system has this mismatch then system status won't work. Fix was to ...


3

Cross-origin refers to accessing resources on a different domain. It's curious that URLs you reference are actually different domains -- www.netzwerk-n.org vs netzwerk-n.org. You might want to check which of those appear in (a) the URL bar (b) the Resource URLs (esp under "?" help button) and (c) the outputted HTML documents. As an alternative to "Debug" ...


3

How to check your Angular version Go to the default Angular base page for your site at http://example.org/civicrm/a Open a browser console Evaluate angular.version within the console: Notes about Angular versions 1.x is called "AngularJS" and has documentation at docs.angularjs.org 2.x (onwards) is called "Angular", has significant changes from 1.x, and ...


3

In case of an angular page use something like function myext_civicrm_angularModules(&$angularModule) { [...] $session =& CRM_Core_Session::singleton(); drupal_add_js(array('CurrentCiviUid' => $session->get('userID')), 'setting'); [...] } and access it in JS: var uid = Drupal.settings.CurrentCiviUid;


3

Short answer: add this to the top of your main angular html template: <h1 crm-page-title>{{ts('Hello')}}</h1> More info: Documentation can be found in the crmUi code. This feature is in 4.7+ (although if you use it in 4.6 it won't crash - it just won't look as good). Note the support for setting document title seperately if you wish.


3

Found the problem. Debugging was turned on. Once I turned it off "New Mailing" worked.


3

I guess this is not the best way to do it and perhaps someone can point you to a better solution. I'll put it as an answer for readability purposes. Edit Create a custom extensions or use an exiting and implement hook_civicrm_pageRun, something like: function myextension_civicrm_pageRun(&$page){ $pageName = $page->getVar('_name'); if ($pageName ...


2

This will not be happening for 4.7. (NB I realise I may not be adding much to above comments but am trying to get some unanswered questions answered as that is currently the 'weakest' aspect of our Beta civicrm stackexchange according to these [stats][1])


2

I found a solution for this. The developer docs (https://docs.civicrm.org/dev/en/latest/framework/angular/loader/) mention how you could create your own angular page, which is a regular civicrm page but at a different url. Because it is a regular page I could set permissions for that just as I was used to do. See https://docs.civicrm.org/dev/en/latest/...


2

I believe you first need to generate a module, à la civix generate:angular-module. Have you already done that?


2

With even version 5 of civicrm it is still using angular 1.5. I checked it on the demo site https://demo.circle-interactive.co.uk/civicrm/a on the console i ran: angular.version, and it returned this :- {full: "1.5.11", major: 1, minor: 5, dot: 11, codeName: "princely-quest"}


2

I had this issue as well and tried all the suggestions above to no avail. Eventually, I found that because I had redirected my site to www.mysite.com instead of mysite.com I was getting this error: "No 'Access-Control-Allow-Origin' header is present on the requested resource." I updated the resource URLs to absolute paths with: https://www.mysite....


2

For a Javascript-only solution, you can also make an API call using user_contact_id for the contact ID. For instance: $result = civicrm_api3('Contact', 'get', [ 'sequential' => 1, 'return' => ["id"], 'id' => "user_contact_id", ]);


2

I just fixed this issue on a site I was working on. Hopefully it helps you as well. My issue was directory permissions. You need to make sure that all of your directories have permissions set to 755. My contribute folder was set to 750, which did not allow the directory structure to be loaded beyond that point. Because of that, it's not able to load the ...


2

It looks like you have a config mismatch between your CMS and your CRM. The tell is in the CORS error in the screenshot you provided. It looks like your site is serving content at https://www.example.org while CiviCRM has specified a base URL of https://example.org. (Note that one URL includes the "www" subdomain while the other does not.) These URLs have ...


1

When I had this issue, it was linked to the url paths. I know you said you checked these but I’d double check paths.


1

Reinstalling Sparkpost extension did the trick.


1

In addition to cleaning up caches via Administer menu » System Settings » Cleanup Caches and Update Paths, it also pays to delete the templates_c directory.


1

At some point I recognized that it's not only the new mailing page that doesn't load when I disable debugging, but also the system status page wouldn't. So I thought, both things might have something in common. And it turned out, that they do, as they both angular pages (I don't really know what that means, but well that seems to connect them). With that ...


1

For some reason, you can't use the ngOptions directive with select2 multi-select elements. You need to manually specify the <option> elements with ngRepeat like this instead: <select crm-ui-select="{allowClear: true}" ng-model="myVar" multiple="multiple" class="big" > <option ng-repeat="option in options" value="{{option.value}}"&...


1

This is my answer pasted from this question We had one site that had 'lost' all it angular pages, eg CiviMail and System Status. In our case the angular cache files were returning 404 on the New Mailing page. (and 'inspector' was showing a lot of red angular errors) It was building the cache files in sites/default/files/civicrm/images, but then ...


1

At time of writing (circa 4.7.20), the crm-ui-tab-set directive does not support an option to manage the active tab. I think a patch to support that would be welcome. For example, one might update crm-ui-tab-set (in ang/crmUi.js) to support an extra variable active-tab with an interface like this: <div crm-ui-tab-set active-tab="selectedTab"> <...


1

selectedMail is a function on the route´s resolve property, I believe you cannot inject it into another controller because the controller is instantiated in the route, but you can access the resolve property anywhere injecting the $route service like this: ... angular.module('crmMailing').controller('crmMailingRecurScheduleCtrl', function($scope, $filter, $...


1

What you want to do now is decorate the directive ;) The decorator method allows you to decorate/modify an angular directive/service/factory/controller before its usage/instantiated. You have two options (that I know of) to manipulate the directives DOM, one is the compile function, used for template DOM manipulation (is where the template is actually ...


1

There is no way through the UI that I am aware of.


1

What about modifying the option list itself? So pick a hook that fires whenever the new mailing page is loaded (hook pageRun or something) and use the api to check if the current user's email is an option in that list. If not, add it That gets you halfway there... not sure about setting it as the default. I suppose if you made it the default every time the ...


Only top voted, non community-wiki answers of a minimum length are eligible