RealURL 2.2.1 remove segment/pagePath completly from generated URL - typo3-7.6.x

I have a problem regarding the new RealURL version 2.2.1. After upgrading to Typo3 7.6 we got the new RealURL version. The concept in the old version (6.2) was that the pagePath in the URL was completely empty.
For example if you the following tree is:
page1
-- page2
---- page3
the url for page3 was http://test.de/page3.html so the complete pagePath and subfolders were removed from the URL. In the old configuration we could get that effect if the pagePath segment in the realURL configuration was empty.
<?php
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl'] = array(
'_DEFAULT' => array(
'init' => array(
'enableCHashCache' => true,
'appendMissingSlash' => 'ifNotFile,redirect',
'adminJumpToBackend' => false,
'enableUrlDecodeCache' => true,
'enableUrlEncodeCache' => true,
'emptyUrlReturnValue' => '/',
),
'fileName' => array(
'defaultToHTMLsuffixOnPrev' => 1,
'acceptHTMLsuffix' => 1,
),
'pagePath' => array(),
),
);
In the new version it isn't working anymore. I've tried a lot now to get the same state as before. But all i get is an URL with the complete path for example http://test.de/page1/page2/page3.html. This would destroy all URLs on Google. Does anyone know how i can fix that problem?

Go to your database and and set the field tx_realurl_exclude ("Exclude from speaking URL") to 1 for all pages (and pages_language_overlay) records.
Make sure every new page has set this value by default.

Related

TYPO3 E-Mail Spam Protection

I’ve got a Problem with spam protection in TYPO3 v9.5 for a long time in my own template extension and custom content elements.
I would expect, that the E-Mail Links inserted via TypoLink in ckEditor would be transformed to name(at)domain.de in the frontend by using the following snippet in my Setup. But its simply is ignored:
config.spamProtectEmailAddresses = 2
config.spamProtectEmailAddresses_atSubst = <span>(at)</span>
I’ve set up a clean Installation with 9.5.15 and it just works. So I think it has something to do with my template-extension or my custom components with custom ckEditor config.
Can someone with a better understanding of TYPO3 please guide me to the right direction?
Here is my TCA for the Textfield:
'bodytext' => [
'exclude' => true,
'label' => 'Kontaktdaten',
'config' => [
'type' => 'text',
'cols' => 40,
'rows' => 3,
'softref' => 'rtehtmlarea_images,typolink_tag,email[subst],url',
],
'defaultExtras' => 'richtext:rte_transform[flag=rte_enabled|mode=ts_css]'
],
compare your TCA field configuration with the configuration of the field tt_content.bodytext
I guess you missed: config.softref = typolink_tag,images,email[subst],url

Cannot create an ad or ad creative via the facebook API

So I'm working on a project from work using the facebook API so we can build ads (yes I know you can do it from facebook ads manager but my company wants me to create our own interface). Anyways so I'm able to create campaigns and ad sets through the API but I cannot seem to have any luck with ads and or creatives.
{message: "Invalid parameter", exception: "FacebookAds\Http\Exception\AuthorizationException",…}
exception
:
"FacebookAds\Http\Exception\AuthorizationException"
file
:
"/Users/bradgoldsmith/Desktop/SquibLib/vendor/facebook/php-ads-sdk/src/FacebookAds/Http/Exception/RequestException.php"
line
:
144
message
:
"Invalid parameter"
trace
:
[{,…}, {,…},…]
That's the error I seem to get and from the looks it has something to do with Authorization but I'm able to create campaigns and ad sets so I figured I'm authorized. I'm just testing dummy data on a page that I am an admin on. Any advice or pointers in the right direction would be greatly appreciated.
So turns out the authorization issue has something to do with the fact that our app is still in review. I was able to however create a carousel ad/ad creative through their API with this bit of code, which I also got from their documentation. Anyways the code that worked for me is here:
$product1 = (new AdCreativeLinkDataChildAttachment())->setData(array(
AdCreativeLinkDataChildAttachmentFields::LINK =>
'https://www.link.com/product1',
AdCreativeLinkDataChildAttachmentFields::NAME => 'Product 1',
AdCreativeLinkDataChildAttachmentFields::DESCRIPTION => '$8.99',
AdCreativeLinkDataChildAttachmentFields::IMAGE_HASH => '<IMAGE_HASH>',
));
$product2 = (new AdCreativeLinkDataChildAttachment())->setData(array(
AdCreativeLinkDataChildAttachmentFields::LINK =>
'https://www.link.com/product2',
AdCreativeLinkDataChildAttachmentFields::NAME => 'Product 2',
AdCreativeLinkDataChildAttachmentFields::DESCRIPTION => '$9.99',
AdCreativeLinkDataChildAttachmentFields::IMAGE_HASH => '<IMAGE_HASH>',
));
$product3 = (new AdCreativeLinkDataChildAttachment())->setData(array(
AdCreativeLinkDataChildAttachmentFields::LINK =>
'https://www.link.com/product3',
AdCreativeLinkDataChildAttachmentFields::NAME => 'Product 3',
AdCreativeLinkDataChildAttachmentFields::DESCRIPTION => '$10.99',
AdCreativeLinkDataChildAttachmentFields::IMAGE_HASH => '<IMAGE_HASH>',
));
$link_data = new AdCreativeLinkData();
$link_data->setData(array(
AdCreativeLinkDataFields::LINK => '<URL>',
AdCreativeLinkDataFields::CHILD_ATTACHMENTS => array(
$product1, $product2, $product3,
),
));
$object_story_spec = new AdCreativeObjectStorySpec();
$object_story_spec->setData(array(
AdCreativeObjectStorySpecFields::PAGE_ID => <PAGE_ID>,
AdCreativeObjectStorySpecFields::LINK_DATA => $link_data,
));
$creative = new AdCreative(null, 'act_<AD_ACCOUNT_ID>');
$creative->setData(array(
AdCreativeFields::NAME => 'Sample Creative',
AdCreativeFields::OBJECT_STORY_SPEC => $object_story_spec,
));
$creative->create();

Hybridauth + composer: how to add custom providers

I'm converting a php project to use composer as dependency manager.
The dependencies are loaded via this line in my main script.
require 'vendor/autoload.php';
One of these dependencies is hybridauth (version 2.9). Since using Composer, it throws 'file not found' errors when looking for custom providers files.
For instance, my main controller calls Hybrid like this:
$config_file_path = dirname(__FILE__) .'/hybridauth/config.php';
$hybridauth = new Hybrid_Auth( $config_file_path );
Now, here is the config file. The provider i'm using is "Facebooktest".
Note that I had to specify the path via the [wrapper][path]; array key to get to the next error message.
return
array(
"base_url" => WWWROOT."/auth",
"providers" => array(
"Facebook" => array(
"enabled" => true,
"keys" => array("id" => "xxxxxxx", "secret" => "xxxxxxxx"),
"scope" => "email",
"trustForwarded" => false
),
"Facebooktest" => array(
"enabled" => true,
"keys" => array("id" => "xxxxxxx", "secret" => "xxxxxx"),
"scope" => "email",
"trustForwarded" => false,
"wrapper"=> array(
"class"=>'Hybrid_Providers_Facebooktest',
"path"=> './controllers/hybridauth/Hybrid/Providers/Facebooktest.php'
)
)
),
"debug_mode" => false,
"debug_file" => "",
);
The error message (with trace):
require_once(/path/to/composer-project/vendor/hybridauth/hybridauth/hybridauth/Hybrid/thirdparty/Facebook/autoload.php): failed to open stream: No such file or directory
[vendor/bcosca/fatfree/lib/base.php:2174] Base->error()
[controllers/hybridauth/Hybrid/Providers/Facebooktest.php:61] Base->{closure}()
[controllers/hybridauth/Hybrid/Providers/Facebooktest.php:61] require_once()
[vendor/hybridauth/hybridauth/hybridauth/Hybrid/Provider_Model.php:99] Hybrid_Providers_Facebooktest->initialize()
[vendor/hybridauth/hybridauth/hybridauth/Hybrid/Provider_Adapter.php:101] Hybrid_Provider_Model->__construct()
[vendor/hybridauth/hybridauth/hybridauth/Hybrid/Auth.php:278] Hybrid_Provider_Adapter->factory()
[vendor/hybridauth/hybridauth/hybridauth/Hybrid/Auth.php:230] Hybrid_Auth::setup()
[controllers/auth-action.get.php:19] Hybrid_Auth::authenticate()
I find it strange that I now need to modify paths inside the "vendor/hybridauth/" project. It defeats the purpose of using a dependency manager. Surely, I must be doing it wrong.
Can you advise?
Check my answer to another question here
If you have recently installed Hybridauth through composer you probably have downloaded v2.9.2, which contain a bug in their Facebook class that replace the vendor path from yours to hybridauth/vendor, causing such issue.
I suspect you created that Facebooktest class by copying their Facebook class and therefore sustained that error. Either update to their dev branch and copy that Facebook class, or simply use other provider class as template for your custom provider class.

after installing magento cannot login admin

After installing Magento admin panel cannot log in. I have installed magento on my localhost. After all the setup when I used the admin page to login I can't able to login in chrome browser even with my right username and password
I found this solution : Go to app/code/core/Mage/Core/Model/Session/Abstract/Varien.php file within your magento directory and comment out these 3 lines of code :
Also the comma must be removed from the file .Save it and try to login to your magento admin panel.
// 'domain' => $cookie->getConfigDomain(),
// 'secure' => $cookie->isSecure(),
// 'httponly' => $cookie->getHttponly()
first check your local server (like wamp, xammp etc) is working correct
second chack your appache configaration port is 80 .... and
third goto magento directory and see if manifast.flag file in that directory delete it ...
Try it in Firefox , I have faced the same issue but when i tried in Firefox i logged in successfully.
it happens to me after installing everytime,
find this file:
app\code\core\Mage\Core\Model\Session\Abstract\Varien.php
And commenting out the following (it's lines 85 to 102)
// session cookie params
$cookieParams = array(
'lifetime' => $cookie->getLifetime(),
'path' => $cookie->getPath()//,
//'domain' => $cookie->getConfigDomain(),
//'secure' => $cookie->isSecure(),
//'httponly' => $cookie->getHttponly()
);
//if (!$cookieParams['httponly']) {
// unset($cookieParams['httponly']);
// if (!$cookieParams['secure']) {
// unset($cookieParams['secure']);
// if (!$cookieParams['domain']) {
// unset($cookieParams['domain']);
// }
// }
//}

laravel rename lara_admin bundle name in url

I am using lara_admin bundle for my admin panel which is accessible under msmohan.com/lara_admin path.
I don't want to show the lara_admin in the url. So can anyone tell me is there any option for renaming the url link?
When you install a module and register it, you set it up like with this configuration:
'lara_admin' => array(
'handles' => 'lara_admin',
'auto' => true,
),
When the bundle registers routes, it uses that handles key as the basis for the route. So in the bundle's routes.php file, you can see:
Route::get('(:bundle)/login', 'lara_admin::sessions#index');
See that (:bundle)? That tells Laravel to look up the handles key. So if you change your registration for the lara_admin bundle to:
'lara_admin' => array(
'handles' => 'admin',
'auto' => true,
),
It will now be at /admin/login, for example.

Resources