theming – Notices and warnings in drupal 7 theme: Illegal string offset and undefined index (template.php)

These notices are not Drupal specific. In the first notice / warning, you are accessing $value('id') without checking if it exists first (and it sometimes doesn’t exist).

Warning: Illegal string offset ‘id’ in run_one_five_breadcrumb() (line
27)

Notice: Undefined index: id in run_one_five_breadcrumb() (line 27)

To resolve this, check if it exists first. For example:

if (isset($value('id'))) { // or use !empty() if more appropriate.
  // Do something with $value('id').
}

The second message is because you are using -> to access a value in an array. It’s only for working with objects. And you actually are looking at the wrong line for your code in question, the issue is on the line inside the if statement, not in the if check.

Notice: Trying to get property ‘name’ of non-object in
run_one_five_breadcrumb() (line 30)

To resolve this issue, always treat $translated_term as an array, because it is one. Note that you’re doing it correctly in your if statement, just not in the body.

if (drupal_strlen($translated_term('name')) > 0) { // Accessing name correctly!
  $crumbs .= 'etc' . $translated_term->name . 'etc'; // Incorrect! $translated_term is not an object.
  // Resolution:
  $crumbs .= 'etc' . $translated_term('name') . 'etc'; // Correct!
}

shell – linux – bash – read: Illegal option -n

on Ubuntu , I try to pause a bash shell script

!#/bin/bash
...
read -n 1 -p"pause"

I have seen that syntax everywhere so I don’t understand why is it not working

and I get this error

./build.sh: 14: read: Illegal option -n

what I also don’t understand is that in the read man, there are no -n -p options

are there 2 different read commands in linux ?

sheers

❕NEWS – Selling paypal funds for real cash might be illegal | Proxies123.com

hahha you are doing what I am doing now
I am selling Euro Paysera for cash in my local currency and of course, it isn’t legal but we don’t have another choice to get Euro or dollars because BANK can’t sell for us that currency.

that’s called Black market

having drones in germany illegal

Am living in Germany but I travel a lot around the world, my new hobby is aerial photography, for this am considering to buy a drone, :]

enter image description here

since Germany has some rules about drones,
can I have a drone in Germany without a “mandatory label marking” “without insurance” etc?
I mean, the rules are clear for me IF AND ONLY IF am flying the drone in Germany but if I have and use it only when in vacations in other countries? am i braking any rule?

Thanks guys!

❕NEWS – Bitcoin Used For Illegal Activities In South Korea | Proxies123.com

Earnings Disclaimer:  All the posts published herein are merely based on individual views, and they do not expressly or by implications represent those of Proxies123.com or its owner. It is hereby made clear that Proxies123.com does not endorse, support, adopt or vouch any views, programs and/or business opportunities posted herein. Proxies123.com also does not give and/or offer any investment advice to any members and/or it’s readers. All members and readers are advised to independently consult their own consultants, lawyers and/or families before making any investment and/or business decisions. This forum is merely a place for general discussions. It is hereby agreed by all members and/or readers that Proxies123.com is in no way responsible and/or liable for any damages and/or losses suffered by anyone of you.

Why is the KKK illegal, but Black Lives Matter isn’t?

Do you speak English as a second language? where are you from? 

because I cant even understand anything that you asked.   The correct grammar for your questions is “Why the USA government makes KKK illegal but they let “Black Lives matter” legal?”

so the answer is because KKK is not a company nor a religion which the government can rule.    KKK is more a community group.   One guy gathers white people to say that they are superior to minority and they bullies the minorities (Black, Jews and Mexicans).   Well to be honest, these people are obviously have too much time.  If you have a business such as a Chicken restaurant, you dont have time for this BS and gather people to talk about minority’s problems.    

And regarding the “Black Lives Matter”, it is a motto for the American people for not bullying the black African Americans (since they are poor and some become a low life criminals).   It is not a company nor a religion that the government can rule.   Regarding the looting, of course, it is illegal.  

PS: I’m not a lawyer but I can read everything on the internet so google it…..

 

It’ now illegal for PRIVTE employer to fire someone for being LGBT in all 50 state; in your face cons?

The Supreme Court got it WRONG!  The Civil Rights Act of 1964 was about sexual discrimination by employers, however, at that time ‘sex’ was described as MALE and FEMALE only.  The only way, this can be changed………is to generate an Amendment, pass it and make it a law to include LGBTQ’s.  Right now, as it stands, any employer can fire anyone for any reason.  The Supreme Court seems to have forgotten about how things are done legally.

[ Law & Ethics ] Open Question : Is it illegal to swim in a public fountain?

I know it’s rude, but is it *illegal*?

8 – Specified illegal length modifier

I started getting this error when I try to load admin pages:

Fatal error: Illegal length modifier specified 'f' in s(np)printf call in /home/mypath/public_html/mysite.com/core/lib/Drupal/Component/PhpStorage/MTimeProtectedFastFileStorage.php on line 88

The offensive line of code:

$result = rename($temporary_path, $full_path);

I registered the variables that are used in the name change function

$temporary_path = sites/default/files/php/twig/.Lmc1W8Ah3a0Ti25OSi6EWRhRrak

$full_path = sites/default/files/php/twig/5eb6d88f951ea_input.html.twig_BDyoxtSNo6EAtdqLkk7vWqrEZ/Y3dUT4hvb70S6IlToElkUoP3liser_VNlYRsxFliuEg.php

The error appeared out of nowhere. I tried to reverse the code of the theme I was working on and even my database, but this error is persistent. If anyone has any ideas on how to solve this please help. I'm not even sure how to start to fix this.

reverse trace:

0 /home/mypath/public_html/mysite/core/lib/Drupal/Core/Template/TwigPhpStorageCache.php(111): DrupalComponentPhpStorageMTimeProtectedFastFileStorage->save('5e81140a7fd53_i...', 'write('5e81140a7fd53_i...', 'loadClass('__TwigTemplate_...', 'core/themes/cla...', NULL)
3 /home/mypath/public_html/mysite/core/themes/engines/twig/twig.engine(64): TwigEnvironment->loadTemplate('core/themes/cla...')
4 /home/mypath/public_html/mysite/core/lib/Drupal/Core/Theme/ThemeManager.php(384): twig_render_template('core/themes/cla...', Array)
5 /home/mypath/public_html/mysite/core/lib/Drupal/Core/Render/Renderer.php(431): DrupalCoreThemeThemeManager->render('input', Array)
6 /home/mypath/public_html/mysite/core/lib/Drupal/Core/Render/Renderer.php(444): DrupalCoreRenderRenderer->doRender(Array)
7 /home/mypath/public_html/mysite/core/lib/Drupal/Core/Render/Renderer.php(444): DrupalCoreRenderRenderer->doRender(Array)
8 /home/mypath/public_html/mysite/core/lib/Drupal/Core/Render/Renderer.php(444): DrupalCoreRenderRenderer->doRender(Array)
9 /home/mypath/public_html/mysite/core/lib/Drupal/Core/Render/Renderer.php(200): DrupalCoreRenderRenderer->doRender(Array, false)
10 /home/mypath/public_html/mysite/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php(226): DrupalCoreRenderRenderer->render(Array, false)
11 /home/mypath/public_html/mysite/core/lib/Drupal/Core/Render/Renderer.php(573): DrupalCoreRenderMainContentHtmlRenderer->DrupalCoreRenderMainContent{closure}()
12 /home/mypath/public_html/mysite/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php(227): DrupalCoreRenderRenderer->executeInRenderContext(Object(DrupalCoreRenderRenderContext), Object(Closure))
13 /home/mypath/public_html/mysite/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php(117): DrupalCoreRenderMainContentHtmlRenderer->prepare(Array, Object(SymfonyComponentHttpFoundationRequest), Object(DrupalCoreRoutingCurrentRouteMatch))
14 /home/mypath/public_html/mysite/core/lib/Drupal/Core/EventSubscriber/MainContentViewSubscriber.php(90): DrupalCoreRenderMainContentHtmlRenderer->renderResponse(Array, Object(SymfonyComponentHttpFoundationRequest), Object(DrupalCoreRoutingCurrentRouteMatch))
15 (internal function): DrupalCoreEventSubscriberMainContentViewSubscriber->onViewRenderArray(Object(SymfonyComponentHttpKernelEventGetResponseForControllerResultEvent), 'kernel.view', Object(DrupalComponentEventDispatcherContainerAwareEventDispatcher))
16 /home/mypath/public_html/mysite/core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php(111): call_user_func(Array, Object(SymfonyComponentHttpKernelEventGetResponseForControllerResultEvent), 'kernel.view', Object(DrupalComponentEventDispatcherContainerAwareEventDispatcher))
17 /home/mypath/public_html/mysite/vendor/symfony/http-kernel/HttpKernel.php(156): DrupalComponentEventDispatcherContainerAwareEventDispatcher->dispatch('kernel.view', Object(SymfonyComponentHttpKernelEventGetResponseForControllerResultEvent))
18 /home/mypath/public_html/mysite/vendor/symfony/http-kernel/HttpKernel.php(68): SymfonyComponentHttpKernelHttpKernel->handleRaw(Object(SymfonyComponentHttpFoundationRequest), 1)
19 /home/mypath/public_html/mysite/core/lib/Drupal/Core/StackMiddleware/Session.php(57): SymfonyComponentHttpKernelHttpKernel->handle(Object(SymfonyComponentHttpFoundationRequest), 1, true)
20 /home/mypath/public_html/mysite/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(47): DrupalCoreStackMiddlewareSession->handle(Object(SymfonyComponentHttpFoundationRequest), 1, true)
21 /home/mypath/public_html/mysite/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): DrupalCoreStackMiddlewareKernelPreHandle->handle(Object(SymfonyComponentHttpFoundationRequest), 1, true)
22 /home/mypath/public_html/mysite/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupalpage_cacheStackMiddlewarePageCache->pass(Object(SymfonyComponentHttpFoundationRequest), 1, true)
23 /home/mypath/public_html/mysite/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(47): Drupalpage_cacheStackMiddlewarePageCache->handle(Object(SymfonyComponentHttpFoundationRequest), 1, true)
24 /home/mypath/public_html/mysite/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(52): DrupalCoreStackMiddlewareReverseProxyMiddleware->handle(Object(SymfonyComponentHttpFoundationRequest), 1, true)
25 /home/mypath/public_html/mysite/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): DrupalCoreStackMiddlewareNegotiationMiddleware->handle(Object(SymfonyComponentHttpFoundationRequest), 1, true)
26 /home/mypath/public_html/mysite/core/lib/Drupal/Core/DrupalKernel.php(694): StackStackedHttpKernel->handle(Object(SymfonyComponentHttpFoundationRequest), 1, true)
27 /home/mypath/public_html/mysite/index.php(19): DrupalCoreDrupalKernel->handle(Object(SymfonyComponentHttpFoundationRequest))
28 {main}

nodejs – Error: Illegal arguments: number at Object.bcrypt.getSalt encrypt – Does not encrypt password

I do not understand what the error may be, the documentation mentions that the minimum number to generate the salt is 10 and I am using it, if someone could help me.

This is the code that I execute when registering a user.

usersController.singUp = async (req, res) => {
    const { name, email, password, confirm_password } = req.body;
    const errors = ();
    let data = { name, email };

    if (password != confirm_password) errors.push({ text: "Passwords no coinciden" });
    if (password.length < 4) errors.push({ text: "El password es menor a 4 caracteres" }); 

    // console.log(req.body);
    // console.log(errors);

    if (errors.length > 0) res.render('users/singup', { errors, data });
    else {
        const emailUser = await User.findOne({ email: email });

        if(emailUser){
            req.flash('error_msg','The email is alredy in use');
            res.redirect('/users/singup');
        } else {
            try {
                let newUser = new User({ name, email, password });

                // Cifraremos la contraseña
                newUser.password = await newUser.encryptPassword(password);
                // Guardamos al usuario
                let result = await newUser.save();
                // console.log(result);
                req.flash('success_msg', 'You are registered');
                res.redirect('/users/singin');
            } catch (error) {
                console.log(error);
            }
        }
    }
};

This is the path I use to run it.

router.post('/users/singup', singUp);

And this is the model that I use for users.

const { Schema, model } = require('mongoose');
const bcrypt = require('bcryptjs');

const userSchema = new Schema({
    name: { type: String, required: true },
    email: { type: String, required: true , unique: true},
    password: { type: String, required: true }
},{ timestamps: true });

// Cifra la comtraseña
userSchema.methods.encryptPassword = async (password) => {
    console.log('antes');

    const salt = await bcrypt.getSalt(10);
    console.log(salt);
    const hash = await bcrypt.hash(password, salt);
    console.log(hash);

    return hash;
}

// Compara la contraseña con la de la bd
userSchema.methods.matchPassword = async function(password){
    await bcrypt.compare(password, this.password);
};

const User = model('User', userSchema);

module.exports= User;

However, wanting to encrypt the password and wanting to save it together with the new user throws the following error:

enter the image description here

I already looked for the error but none of the things that I have found have helped me to fix it and understand why the error is due.